SQLite3 sugar built ontop of node-sqlite3 for Node.js.
Supported platforms
The sqlite3
module which lite3
is built on works with Node.js v0.10.x, v0.12.x, v4.x, and v5.x.
Binaries for most Node versions and platforms are provided by default via node-pre-gyp.
Purpose
I created this library to simplify querying, updating, inserting a SQLite3 database.
Example of updating a row:
lite3
Installing
You can use npm
to download and install:
- The latest
lite3
package:npm install lite3
Usage
Check the Api
section to see more examples and uses.
const lite = ;const lite3 = 'database.db'lite3;
Api
new lite3(file)
Creates a new Class
with the passed in file as a the name of the SQLite3 database that you want to connect.
{string}
file
- filename of the database you want to make SQL operations on.
EX:
const lite = ;const lite3 = 'DBname.db';
lite3.table(tbl)
Sets the lite3.tableName property and returns the class to perform chainable SQL queries on the specified table.
{string}
tbl
- Name of the table desired to perform SQL queries.
EX:
lite3
Once the table is set, you can perform multiple queries on the table. To perform queries on another table you must specifiy the table by running lite.table(tbl) again to set a new table to perform queries.
Example of running two seperate queries on the same table blog_post
:
lite3 ; lite3 ;