https://github.com/themost-framework/sqlite
MOST Web Framework SQLite Data Adapter
https://github.com/themost-framework/sqlite
database query query-builder query-language sql sqlite
Last synced: 3 months ago
JSON representation
MOST Web Framework SQLite Data Adapter
- Host: GitHub
- URL: https://github.com/themost-framework/sqlite
- Owner: themost-framework
- License: bsd-3-clause
- Created: 2020-04-28T15:56:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-12T04:25:04.000Z (3 months ago)
- Last Synced: 2025-04-12T05:27:43.573Z (3 months ago)
- Topics: database, query, query-builder, query-language, sql, sqlite
- Language: JavaScript
- Homepage:
- Size: 1.99 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://www.npmjs.com/package/@themost%2Fsqlite)


[](https://github.com/themost-framework/sqlite/blob/master/LICENSE)


[](https://www.npmjs.com/package/@themost%2Fsqlite)
# @themost/sqlite
MOST Web Framework SQLite Data AdapterLicense: [BSD-3-Clause](https://github.com/themost-framework/sqlite/blob/master/LICENSE)
## Install
npm install @themost/sqlite
## Usage
Register SQLite adapter on app.json as follows:
"adapterTypes": [
...
{ "name":"SQLite Data Adapter", "invariantName": "sqlite", "type":"@themost/sqlite" }
...
],
adapters: [
...
{
"name":"local-db", "invariantName":"sqlite", "default":true,
"options": {
database:"db/local.db"
}
}
...
]
}or create a new instance of `SqliteAdapter` class for connecting to SQLite database.
```javascript
const { SqliteAdapter } = require('@themost/sqlite');
const { QueryExpression } = require('@themost/query');
const db = new SqliteAdapter({
database: 'db/local.db'
});
const query = new QueryExpression()
.select(({ id, name, category, model, price }) => ({
id,
name,
category,
model,
price,
})).from('ProductData')
.where((x) => {
return x.price > 500 && x.category === "Laptops";
})
.orderByDescending((x) => x.price)
.take(10);
const items = await db.executeAsync(query);
```Read more about [MOST Web Framework query language provided by @themost/query](https://github.com/themost-framework/query?#themostquery)
Use [query playground project at codesanbox.io](https://codesandbox.io/p/devbox/query-playground-zc8fg9) to learn more about the query language specification of [@themost-framework](https://github.com/themost-framework)
