@travetto/model-sqlite 7.0.0-rc.4 → 7.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -7
- package/src/dialect.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-sqlite",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.5",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "SQLite backing for the travetto model module, with real-time modeling support for SQL schemas.",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"sql",
|
|
@@ -26,13 +27,13 @@
|
|
|
26
27
|
"directory": "module/model-sqlite"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@travetto/config": "^7.0.0-rc.
|
|
30
|
-
"@travetto/context": "^7.0.0-rc.
|
|
31
|
-
"@travetto/model": "^7.0.0-rc.
|
|
32
|
-
"@travetto/model-query": "^7.0.0-rc.
|
|
33
|
-
"@travetto/model-sql": "^7.0.0-rc.
|
|
30
|
+
"@travetto/config": "^7.0.0-rc.5",
|
|
31
|
+
"@travetto/context": "^7.0.0-rc.5",
|
|
32
|
+
"@travetto/model": "^7.0.0-rc.5",
|
|
33
|
+
"@travetto/model-query": "^7.0.0-rc.5",
|
|
34
|
+
"@travetto/model-sql": "^7.0.0-rc.5",
|
|
34
35
|
"@types/better-sqlite3": "^7.6.13",
|
|
35
|
-
"better-sqlite3": "^12.
|
|
36
|
+
"better-sqlite3": "^12.5.0"
|
|
36
37
|
},
|
|
37
38
|
"travetto": {
|
|
38
39
|
"displayName": "SQLite Model Service",
|
package/src/dialect.ts
CHANGED
|
@@ -50,11 +50,11 @@ export class SqliteDialect extends SQLDialect {
|
|
|
50
50
|
const IGNORE_FIELDS = [this.pathField.name, this.parentPathField.name, this.idxField.name].map(field => `'${field}'`);
|
|
51
51
|
|
|
52
52
|
const [columns, foreignKeys, indices] = await Promise.all([
|
|
53
|
-
this.executeSQL<{ name: string, type: string,
|
|
53
|
+
this.executeSQL<{ name: string, type: string, is_not_null: 1 | 0 }>(`
|
|
54
54
|
SELECT
|
|
55
55
|
name,
|
|
56
56
|
type,
|
|
57
|
-
${this.identifier('notnull')} <> 0 AS
|
|
57
|
+
${this.identifier('notnull')} <> 0 AS is_not_null
|
|
58
58
|
FROM PRAGMA_TABLE_INFO('${table}')
|
|
59
59
|
WHERE name NOT IN (${IGNORE_FIELDS.join(',')})
|
|
60
60
|
`),
|
|
@@ -81,7 +81,7 @@ export class SqliteDialect extends SQLDialect {
|
|
|
81
81
|
return {
|
|
82
82
|
columns: columns.records.map(col => ({
|
|
83
83
|
...col,
|
|
84
|
-
|
|
84
|
+
is_not_null: !!col.is_not_null
|
|
85
85
|
})),
|
|
86
86
|
foreignKeys: foreignKeys.records,
|
|
87
87
|
indices: indices.records.map(idx => ({
|