@voltro/database 0.25.0 → 0.27.0

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/sql.d.ts CHANGED
@@ -1609,6 +1609,19 @@ export declare interface PlannedOperation {
1609
1609
  };
1610
1610
  }
1611
1611
 
1612
+ /** What happens to the referencing row when the target row goes away. */
1613
+ declare type PluginRefOrphanPolicy =
1614
+ /** Delete the referencing row. For a row that only exists to point at it —
1615
+ * a favourite, a pin, a share. */
1616
+ 'delete'
1617
+ /** Null the column, keeping the row. Requires `.nullable()`; declaring it on
1618
+ * a non-nullable column is refused at declaration rather than failing at the
1619
+ * first delete, months later. */
1620
+ | 'null'
1621
+ /** Do nothing. The explicit "I know, and I handle it myself" — different from
1622
+ * omitting the option, which is the same behaviour arrived at by accident. */
1623
+ | 'keep';
1624
+
1612
1625
  /**
1613
1626
  * Imperative `applyNamespacedSchema` against a fresh SqlClient — the
1614
1627
  * entry point the CLI / runtime use to provision a tenant's namespace
@@ -1881,6 +1894,20 @@ declare interface Table<Name extends string, Fields extends Record<string, Colum
1881
1894
  readonly isReactive: Reactive;
1882
1895
  readonly appliedMixins: ReadonlyArray<AnyMixin>;
1883
1896
  readonly appliedIndexes: ReadonlyArray<TableIndex>;
1897
+ /**
1898
+ * The plugin references DECLARED on this table, surviving `table()`.
1899
+ *
1900
+ * `pluginRefSpecOf` reads a column BUILDER, and materialisation replaces it
1901
+ * with a plain field descriptor — so without this the declaration is
1902
+ * unreadable the moment the table exists, and any tool deriving structure
1903
+ * from the schema sees an ordinary `text()` column.
1904
+ */
1905
+ readonly appliedPluginRefs?: ReadonlyArray<{
1906
+ readonly column: string;
1907
+ readonly target: () => unknown;
1908
+ readonly orphanPolicy: PluginRefOrphanPolicy;
1909
+ readonly onSoftDelete: boolean;
1910
+ }>;
1884
1911
  readonly appliedUniques: ReadonlyArray<TableUnique>;
1885
1912
  readonly appliedFullText: ReadonlyArray<TableFullTextIndex>;
1886
1913
  readonly appliedChecks: ReadonlyArray<TableCheck>;
package/dist/sql.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as e, U as t, a as n, c as r, d as i, ft as a, i as o, n as s, o as c, ot as l, q as u, r as d, s as f } from "./frameworkLiveTables-BQwB8K6R.js";
1
+ import { H as e, U as t, a as n, c as r, d as i, ft as a, i as o, n as s, o as c, ot as l, q as u, r as d, s as f } from "./frameworkLiveTables-CS_Hyhgz.js";
2
2
  import { Effect as p } from "effect";
3
3
  import { createLogger as m } from "@voltro/logger";
4
4
  import { SqlClient as h } from "@effect/sql";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/database",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Browser-safe schema DSL, query builder, and cross-dialect migration planner for Voltro — one schema, every SQL backend.",
5
5
  "keywords": [
6
6
  "voltro",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@effect/sql": "^0.52.0",
46
- "@voltro/logger": "0.25.0",
46
+ "@voltro/logger": "0.27.0",
47
47
  "typeid-js": "^1.2.0",
48
48
  "ulidx": "^2.4.1"
49
49
  },