rado 0.2.10 → 0.2.12

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.
@@ -22,6 +22,9 @@ var Schema;
22
22
  }
23
23
  function recreateTable(table, addedColumns) {
24
24
  const queries = [];
25
+ queries.push(
26
+ Query.Raw({ strings: ["PRAGMA foreign_keys = OFF"], params: [] })
27
+ );
25
28
  const tempTable = { ...table, name: `$$new_${table.name}` };
26
29
  queries.push(Query.CreateTable({ table: tempTable }));
27
30
  queries.push(
@@ -49,6 +52,7 @@ var Schema;
49
52
  );
50
53
  for (const index of Object.values(table.meta().indexes))
51
54
  queries.push(Query.CreateIndex({ table, index }));
55
+ queries.push(Query.Raw({ strings: ["PRAGMA foreign_keys = ON"], params: [] }));
52
56
  return queries;
53
57
  }
54
58
  function upgrade(formatter, local, schema) {
@@ -1,7 +1,6 @@
1
1
  import { Column, ColumnData, OptionalColumn, PrimaryColumn } from './Column';
2
2
  import { Cursor } from './Cursor';
3
3
  import { EV } from './Expr';
4
- import { Fields } from './Fields';
5
4
  import { Index, IndexData } from './Index';
6
5
  import { Selection } from './Selection';
7
6
  interface TableDefinition {
@@ -34,7 +33,7 @@ export declare class TableInstance<Definition> {
34
33
  export type Table<Definition> = Definition & TableInstance<Definition>;
35
34
  export declare namespace Table {
36
35
  export type Of<Row> = Table<{
37
- [K in keyof Row as K extends string ? K : never]: Column<Row[K]> & Fields<Row[K]>;
36
+ [K in keyof Row as K extends string ? K : never]: Column<Row[K]>;
38
37
  }>;
39
38
  export type Select<Definition> = {
40
39
  [K in keyof Definition as Definition[K] extends Column<any> ? K : never]: Definition[K] extends Column<infer T> ? T : never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",