rado 0.1.3 → 0.1.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/dist/Driver.d.ts +1 -1
- package/dist/sqlite/SqliteSchema.js +6 -3
- package/package.json +1 -1
package/dist/Driver.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ declare abstract class SyncDriver extends DriverBase {
|
|
|
42
42
|
}
|
|
43
43
|
interface AsyncDriver {
|
|
44
44
|
<T>(query: Cursor<T>): Promise<T>;
|
|
45
|
-
<T>(...queries: Array<Cursor<any>>): T
|
|
45
|
+
<T>(...queries: Array<Cursor<any>>): Promise<T>;
|
|
46
46
|
(strings: TemplateStringsArray, ...values: any[]): Promise<any>;
|
|
47
47
|
}
|
|
48
48
|
declare abstract class AsyncDriver extends DriverBase {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/sqlite/SqliteSchema.ts
|
|
2
|
-
import { Statement, identifier } from "../Statement.js";
|
|
2
|
+
import { Statement, identifier, raw } from "../Statement.js";
|
|
3
3
|
import { SqliteFormatter } from "./SqliteFormatter.js";
|
|
4
4
|
var SqliteSchema;
|
|
5
5
|
((SqliteSchema2) => {
|
|
@@ -16,7 +16,7 @@ var SqliteSchema;
|
|
|
16
16
|
if (columnData.length === 0 && indexData2.length === 0)
|
|
17
17
|
return void 0;
|
|
18
18
|
const columns = columnData.map(columnInstruction);
|
|
19
|
-
const indexes = indexData2.map(indexInstruction);
|
|
19
|
+
const indexes = indexData2.map(indexInstruction).filter((row) => row[1]);
|
|
20
20
|
return {
|
|
21
21
|
columns: Object.fromEntries(columns),
|
|
22
22
|
indexes: Object.fromEntries(indexes)
|
|
@@ -26,7 +26,10 @@ var SqliteSchema;
|
|
|
26
26
|
function columnInstruction(column) {
|
|
27
27
|
return [
|
|
28
28
|
column.name,
|
|
29
|
-
identifier(column.name).add(column.type.toLowerCase()).addIf(column.pk === 1, "primary key").addIf(column.notnull === 1, "not null").addIf(
|
|
29
|
+
identifier(column.name).add(column.type.toLowerCase()).addIf(column.pk === 1, "primary key").addIf(column.notnull === 1, "not null").addIf(
|
|
30
|
+
column.dflt_value !== null,
|
|
31
|
+
raw("default").add(column.dflt_value)
|
|
32
|
+
).compile(formatter)[0]
|
|
30
33
|
];
|
|
31
34
|
}
|
|
32
35
|
SqliteSchema2.columnInstruction = columnInstruction;
|