1.0.6 • Published 2 years ago

sqlite-document-db v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

UNDER CONSTRUCTION

SQLite Document DB

Use SQLite as a JSON Document Database.

API based on MongoDB's JavaScript API.

Getting started

  1. Install using NPM:
npm i --save sqlite-document-db
  1. Start using it:
import Db from 'sqlite-document-db'

const db = await Db.fromUrl(':memory:') // Can also be a path to your DB file

// Insert some users into a collection
await db.collection('users').insertOne({ username: 'test_user', email: 'test@example.com' })
await db.collection('users').insertMany([
  { username: 'test_user2', email: 'test2@example.com' },
  { username: 'test_user3', email: 'test3@example.com' },
])

const user = await db.collection('users').findOne({ email: 'test3@example.com' })

console.log(user)

Console output of the above:

{
  _id: '626964400e547e782d04d7f1',
  username: 'test_user2',
  email: 'test2@example.com'
}

Examples

Missing Features

Thanks

Thanks to https://github.com/thomas4019/mongo-query-to-postgres-jsonb for being a huge inspiration for this project.

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago