1.7.0 • Published 5 years ago

nano-sqlite v1.7.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Nano-SQLite3

SQLite3 Driver for Nano SQL

NPM

Documentation

Installation

npm i --save nano-sqlite

Usage

import { nSQL } from "nano-sql";
import { nSQLiteAdapter, sqlite3 } from "nano-sqlite";

nSQL("table")
.model([...])
.config({
    mode: new nSQLiteAdapter(":memory:", sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE),
    ...other config options
}).connect()...

That's it, now everything NanoSQL can do you can do with SQLite.

Read about NanoSQL here.

API

When you call new nSQLiteAdapter the arguments are exactly the same as for node-sqlite.

The first argument is optional, it's the name of the SQLite database to create. Leaving the argument empty is the same as passing in ":memory:", which will cause the SQLite database to operate in memory only mode. Passing in a string will cause it to make a database and use that as it's name.

The second argument is optional, One or more of sqlite3.OPEN_READONLY, sqlite3.OPEN_READWRITE and sqlite3.OPEN_CREATE. The default value is OPEN_READWRITE | OPEN_CREATE.

When using this adapter the id you pass into the config object will be ignored.

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

7 years ago