rado 0.1.3 → 0.1.4

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.
@@ -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(column.dflt_value !== null, column.dflt_value).compile(formatter)[0]
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {