|
6 | 6 |  |
7 | 7 |  |
8 | 8 | [](https://www.npmjs.com/package/@themost%2Fsqlite) |
9 | | - |
10 | 9 |
|
11 | 10 |  |
12 | 11 |
|
@@ -40,16 +39,32 @@ Register SQLite adapter on app.json as follows: |
40 | 39 | ] |
41 | 40 | } |
42 | 41 |
|
| 42 | +or create a new instance of `SqliteAdapter` class for connecting to SQLite database. |
43 | 43 |
|
44 | | -#### Post Installation Note: |
45 | | -SQLite Data Adapter comes with a regular expression extension for SQLite (regexp.c). You have to compile this extension as follows: |
| 44 | +```javascript |
| 45 | +const { SqliteAdapter } = require('@themost/sqlite'); |
| 46 | +const { QueryExpression } = require('@themost/query'); |
| 47 | +const db = new SqliteAdapter({ |
| 48 | + database: 'db/local.db' |
| 49 | +}); |
| 50 | +const query = new QueryExpression() |
| 51 | + .select(({ id, name, category, model, price }) => ({ |
| 52 | + id, |
| 53 | + name, |
| 54 | + category, |
| 55 | + model, |
| 56 | + price, |
| 57 | + })).from('ProductData') |
| 58 | + .where((x) => { |
| 59 | + return x.price > 500 && x.category === "Laptops"; |
| 60 | + }) |
| 61 | + .orderByDescending((x) => x.price) |
| 62 | + .take(10); |
| 63 | +``` |
46 | 64 |
|
47 | | -##### Using GCC/MinGW on Windows and Linux |
48 | | -gcc -shared -fPIC -Isqlite3 -o regexp.0.dylib regexp.c |
| 65 | +Read more about [MOST Web Framework query language provided by @themost/query](https://github.com/themost-framework/query?#themostquery) |
49 | 66 |
|
50 | | -##### Using GCC on Mac OSX |
51 | | -gcc -dynamiclib -fPIC -Isqlite3 -o regexp.0.dylib regexp.c |
| 67 | +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) |
52 | 68 |
|
53 | | -##### Microsoft Tools on Windows |
54 | | -cl /Gd regexp.c /I sqlite3 /DDLL /LD /link /export:sqlite3_extension_init /out:regexp.0.dylib |
| 69 | + |
55 | 70 |
|
0 commit comments