Nano-sql is a small and fast database engine that supports federated queries, groupings, transactions, ORM and other functions, supports memory, INDEEDDB, Local Storage, websql, Level DB
<script src= "Https://cdn.jsdelivr.net/npm/[email protected]/dist/nano-sql.min.js" ></script> < Script>Nsql (' Users ')//sets the table name.. Model ([//Set Table Structure{key: ' id ', type: ' int ', props: [' pk ', ' AI ']},//PK = = Primary key, Ai = = Auto Incriment{key: ' name ', type: ' String '}, {key:' Age ', type: ' int '}]). config ({mode:"IDB"//data types used by local storage IDB represents IndexedDB}). Connect ()//Initialize the local data store with only one. Then (function(Result) {returnNsql (). Query (' Upsert ', {//Add a new row of dataName: "Bill", age:20}). exec (); }). Then (function(Result) {returnNsql (). Query (' Upsert ', {//Add a recordName: "Jim", age:23}). exec (); }). Then (function(Result) {returnNsql (). Query (' SELECT '). exec ();//querying all data from the current table}). Then (function(Result) {Console.log (Result)//<= Query Results }) </script>
Basic operation of Nano-sql.js