2.0.1 • Published 3 years ago

knex-sqlite v2.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

Knex-Sqlite

Little wrapper library for creating an instance of knex for an sqlite3 database.

Usage

import knexSqlite, { OPEN_READONLY } from 'knex-sqlite';

const knex = knexSqlite(
    // Required: the name of your databse
    './my-database.sqlite',
    // Optional: the file open mode (defaults to read-write)
    OPEN_READONLY,
    // Optional: the knex constructor options
    {
        debug: true
    }
);

console.log(await knex.select('*').from('blog_posts'));

Dependencies

  • knex: ^2.0.0
  • sqlite3: ^5.0.5

knex-sqlite

Knex Sqlite3

knex-sqlite.default ⇒ Knex

Return an instance of knex for an sqlite3 database. The filename and mode arguments are the same as those in the sqlite3 library

Kind: static property of knex-sqlite
Returns: Knex - Instance of knex library
See: node-sqlite3

ParamTypeDescription
filenamestringThe database to access
modemodeThe mode to open the database as
optionsobjectAdditional knex options

knex-sqlite.OPEN_READONLY : number

Open file as read only

Kind: static typedef of knex-sqlite

knex-sqlite.OPEN_READWRITE : number

Open file as read-write

Kind: static typedef of knex-sqlite

knex-sqlite.OPEN_CREATE : number

Create the file

Kind: static typedef of knex-sqlite

knex-sqlite~mode : OPEN_READONLY | OPEN_READWRITE | OPEN_CREATE

Modes for opening the database with

Kind: inner typedef of knex-sqlite
See: node-sqlite3

knex-sqlite~Knex

Knex instance

Kind: inner external of knex-sqlite
See: Knex

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

4 years ago