@vantreeseba/drizzle-graphql 15.1.3 → 15.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/index.d.cts CHANGED
@@ -1112,6 +1112,11 @@ declare const drizzleExecutorKey: unique symbol;
1112
1112
  * Returns the JS property name of the local column on the parent table and the
1113
1113
  * Column object for the foreign column on the target table, or undefined if the
1114
1114
  * relation internals are not accessible.
1115
+ *
1116
+ * Only the relation's *first* column pair is reported. A relation joined on several columns
1117
+ * (`from: [a, b], to: [x, y]`) is not described fully by it, so anything that reads rows by
1118
+ * this pair alone mixes up parents that share the first column. Read paths use
1119
+ * {@link extractRelationJoinColumnPairs}, which returns every pair.
1115
1120
  */
1116
1121
  declare const extractRelationJoinColumns: (relEntry: TableNamedRelations, parentTable: Table, targetTable: Table) => {
1117
1122
  localColPropName: string;
@@ -1543,8 +1548,15 @@ type SchemaFeatures = {
1543
1548
  * relation left with no input loses its field.
1544
1549
  * - **`onWrite`** — the hooks of the table a nested statement writes fire on the same `tx`,
1545
1550
  * with `payload.nested` set. See {@link BuildSchemaConfig.onWrite}.
1546
- * - **`scope`** and **`contextValues`** — `connect` / `disconnect` / `set` reach only
1547
- * in-scope rows, and a nested `create` is stamped like any insert.
1551
+ * - **`scope`**, **`softDelete`** and **`contextValues`** — `connect` / `disconnect` / `set`
1552
+ * reach only in-scope, unmarked rows (a many-to-many `set` keeps the links it cannot
1553
+ * reach), and a nested `create` is stamped like any insert. A relation whose foreign key
1554
+ * is a `contextValues` column is not offered at all.
1555
+ *
1556
+ * A relation's own `where` limits the rows its writes reach the same way, and takes its
1557
+ * `create` away. A relation joining on more than one column per side is not offered. A
1558
+ * to-one `connect` must match exactly one row. When the parent write produces no row, a
1559
+ * parent-side `create` made for it is rolled back.
1548
1560
  *
1549
1561
  * PostgreSQL and SQLite only. MySQL cannot return the rows it just wrote, which is how a
1550
1562
  * nested write learns the parent's key, so `buildSchema` rejects the flag there. On SQLite
@@ -2131,6 +2143,8 @@ type BuildSchemaConfig = {
2131
2143
  * - Every insert stamps it, including the rows created by a nested `create`.
2132
2144
  * - Updates never write it: an update cannot hand a row to another owner. That includes
2133
2145
  * the conflict branch of an upsert, whose `onConflict.update` does not offer it.
2146
+ * - With `nestedWrites`, a relation whose foreign key is such a column gets no nested-write
2147
+ * field, since every nested operation on it would write the column.
2134
2148
  * - Keyed by the Drizzle schema key, then by the column's property name (not its database
2135
2149
  * name), the same keying {@link BuildSchemaConfig.exclude} uses.
2136
2150
  */
package/dist/index.d.ts CHANGED
@@ -1112,6 +1112,11 @@ declare const drizzleExecutorKey: unique symbol;
1112
1112
  * Returns the JS property name of the local column on the parent table and the
1113
1113
  * Column object for the foreign column on the target table, or undefined if the
1114
1114
  * relation internals are not accessible.
1115
+ *
1116
+ * Only the relation's *first* column pair is reported. A relation joined on several columns
1117
+ * (`from: [a, b], to: [x, y]`) is not described fully by it, so anything that reads rows by
1118
+ * this pair alone mixes up parents that share the first column. Read paths use
1119
+ * {@link extractRelationJoinColumnPairs}, which returns every pair.
1115
1120
  */
1116
1121
  declare const extractRelationJoinColumns: (relEntry: TableNamedRelations, parentTable: Table, targetTable: Table) => {
1117
1122
  localColPropName: string;
@@ -1543,8 +1548,15 @@ type SchemaFeatures = {
1543
1548
  * relation left with no input loses its field.
1544
1549
  * - **`onWrite`** — the hooks of the table a nested statement writes fire on the same `tx`,
1545
1550
  * with `payload.nested` set. See {@link BuildSchemaConfig.onWrite}.
1546
- * - **`scope`** and **`contextValues`** — `connect` / `disconnect` / `set` reach only
1547
- * in-scope rows, and a nested `create` is stamped like any insert.
1551
+ * - **`scope`**, **`softDelete`** and **`contextValues`** — `connect` / `disconnect` / `set`
1552
+ * reach only in-scope, unmarked rows (a many-to-many `set` keeps the links it cannot
1553
+ * reach), and a nested `create` is stamped like any insert. A relation whose foreign key
1554
+ * is a `contextValues` column is not offered at all.
1555
+ *
1556
+ * A relation's own `where` limits the rows its writes reach the same way, and takes its
1557
+ * `create` away. A relation joining on more than one column per side is not offered. A
1558
+ * to-one `connect` must match exactly one row. When the parent write produces no row, a
1559
+ * parent-side `create` made for it is rolled back.
1548
1560
  *
1549
1561
  * PostgreSQL and SQLite only. MySQL cannot return the rows it just wrote, which is how a
1550
1562
  * nested write learns the parent's key, so `buildSchema` rejects the flag there. On SQLite
@@ -2131,6 +2143,8 @@ type BuildSchemaConfig = {
2131
2143
  * - Every insert stamps it, including the rows created by a nested `create`.
2132
2144
  * - Updates never write it: an update cannot hand a row to another owner. That includes
2133
2145
  * the conflict branch of an upsert, whose `onConflict.update` does not offer it.
2146
+ * - With `nestedWrites`, a relation whose foreign key is such a column gets no nested-write
2147
+ * field, since every nested operation on it would write the column.
2134
2148
  * - Keyed by the Drizzle schema key, then by the column's property name (not its database
2135
2149
  * name), the same keying {@link BuildSchemaConfig.exclude} uses.
2136
2150
  */