AtomSQL came from the frustration of working too much with RDBMS systems and typing too much to get the necessary data from the Databases.
This post is an introduction to AtomSQL
Lets go through the following examples to see how we use SQL queries normally and in AtomSQL Format.
1. Create a new table
BEFORE:
AFTER:
So, what has changed ???
We just got rid of the keywords and are letting the {} do the necessary JOB.
TIP: Remember C/C++ Structures ?
2. Inserting new records to the table
Before:
After:
Again, We use () for Tuples and [] for Array representation to get the job done. Keywords have gone away !
TIP: Remember JSON, Perl Arrays ?
3. Updating records
Before
After
Again, we are using // for replacing data and () are used for condition to be used in WHERE Clause
TIP: Remember perl, sed, vim for data replacement ?
4. Deleting records
Before
After
! Bang is the operator for destroying stuff. () is used for WHERE Clause
5. Seleting Records
Before
After
<> is used for Column selection and () is used for WHERE clause
More Features/Limitations/Installation can be read from http://nareshv.github.io/atomsql/
This post is an introduction to AtomSQL
Lets go through the following examples to see how we use SQL queries normally and in AtomSQL Format.
1. Create a new table
BEFORE:
CREATE TABLE myTable (id INTEGER PRIMARYKEY, name VARCHAR(255) ENGINE=INNODB
AFTER:
myTable { id INTEGER PRIMARY KEY, name VARCHAR(255) } ENGINE=INNODB
So, what has changed ???
We just got rid of the keywords and are letting the {} do the necessary JOB.
TIP: Remember C/C++ Structures ?
2. Inserting new records to the table
Before:
INSERT INTO myTable VALUES (1, 'Tom'), (2, 'Jerry')
After:
myTable = [ (1, 'Tom'), (2, 'Jerry') ]
Again, We use () for Tuples and [] for Array representation to get the job done. Keywords have gone away !
TIP: Remember JSON, Perl Arrays ?
3. Updating records
Before
UPDATE myTable SET name = 'Jerry Mouse' Where name = 'Jerry'
After
myTable /name = 'Jerry Mouse'/ (name = 'Jerry')
Again, we are using // for replacing data and () are used for condition to be used in WHERE Clause
TIP: Remember perl, sed, vim for data replacement ?
4. Deleting records
Before
DELETE FROM myTable Where name = 'Jerry'
After
! myTable (name = 'Jerry')
! Bang is the operator for destroying stuff. () is used for WHERE Clause
5. Seleting Records
Before
SELECT * from myTable where name != 'Jerry'
After
myTable <*> (name != 'Jerry')
<> is used for Column selection and () is used for WHERE clause
More Features/Limitations/Installation can be read from http://nareshv.github.io/atomsql/