AtomSQL is Simple Database Query Language for SQL Like systems.
Current SQL is way too much to type for a UNIX/Linux user. So, came up with this simpler syntax to do most of the common tasks.
SQL itself is very complex and AtomSQL is not meant to be a replacement for it. Many Projects like Oracle, Postgresql, MySQL have invested lot of hours building a flexible SQL as per standards. Replacing all that effort in couple of weeks is not the idea.
AtomSQL libraries provide mechanism to convert AtomSQL queries to normal SQL queries.
Below sections explain the syntax with few examples.
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
|
|
Few CLUES to Remember
| AtomSQL | MySQL |
|---|---|
|
|
|
|
|
|
|
|
git clone https://github.com/nareshv/atomsql/
#!/usr/bin/env perl
use AtomSQL;
use strict;
use warnings;
# set the driver
$ENV{ATOMSQL_DRIVER} = 'mysql';
# test the api
my $asql = "DUAL <now()>";
my $sql = atomsql_query($asql);
# print the results
print "ORIGINAL : $asql\n";
print "SQL : $sql\n";
Prints the following output
ORIGINAL : DUAL <now()>
SQL : SELECT now() FROM DUAL
git clone https://github.com/nareshv/atomsql/
<?php
// set the driver
$_ENV{ATOMSQL_DRIVER} = 'mysql';
// test the api
my $asql = "DUAL <now()>";
my $sql = atomsql_query($asql);
// print the results
echo "ORIGINAL : $asql\n";
echo "SQL : $sql\n";
Prints the following output
ORIGINAL : DUAL <now()>
SQL : SELECT now() FROM DUAL
0.1 - Initial version
MIT
Please submit a PR.
~~~