@nextlyhq/adapter-drizzle 0.0.2-alpha.64 → 0.0.2-alpha.66

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.
@@ -423,11 +423,33 @@ interface TransactionContext {
423
423
  /**
424
424
  * Update records.
425
425
  *
426
+ * @remarks
427
+ * Built by the adapter rather than by the Drizzle query builder, as `insert`
428
+ * is: the statement writes the columns the PHYSICAL table has, where the
429
+ * pooled `update` writes the ones the runtime model declares. A column the
430
+ * model declares binds through its own encoder, exactly as the query builder
431
+ * binds it; one it does not declare binds the way this adapter's
432
+ * transactional insert binds every value; a key naming no column on the
433
+ * table is a database error rather than a silent drop. A key whose value is
434
+ * `undefined` is not written, `null` is, and an update naming nothing to
435
+ * write is refused.
436
+ *
437
+ * When `options.returning` asks for rows, they come from a read on this
438
+ * transaction, decoded as every read is — the model's view of the row,
439
+ * whatever columns were named. On PostgreSQL and SQLite that read is by the
440
+ * identities the statement reported through RETURNING, so it is exactly the
441
+ * rows this update changed. MySQL has no RETURNING, so there the read
442
+ * re-runs `where`, as it always has on that dialect: an update whose own
443
+ * write falsifies its `where` reads back nothing, and a row another
444
+ * transaction adds under the predicate meanwhile is included. A fenced
445
+ * compare-and-set wants `updateCount` on every dialect.
446
+ *
426
447
  * @param table - Table name
427
- * @param data - Data to update
448
+ * @param data - Data to update, keyed by SQL column name; Drizzle property
449
+ * names are accepted as well
428
450
  * @param where - Conditions for records to update
429
451
  * @param options - Update options
430
- * @returns Updated records (with RETURNING columns if specified)
452
+ * @returns The updated rows when `returning` asked for them, else `[]`
431
453
  */
432
454
  update<T = unknown>(table: string, data: Record<string, unknown>, where: WhereClause, options?: UpdateOptions): Promise<T[]>;
433
455
  /**
@@ -769,4 +791,4 @@ interface MigrationStatus {
769
791
  pending: Migration[];
770
792
  }
771
793
 
772
- export { type CountOptions as C, type DeleteOptions as D, type InsertOptions as I, type JoinSpec as J, type MigrationRecord as M, type OrderBySpec as O, type PoolStats as P, type SelectOptions as S, type TransactionContext as T, type UpdateOptions as U, type WhereClause as W, type Migration as a, type MigrationStatus as b, type MigrationOptions as c, type MigrationResult as d, type UpsertOptions as e, type TransactionOptions as f, type DatabaseCapabilities as g, type TransactionIsolationLevel as h, WHERE_OPERATORS as i, type WhereCondition as j, type WhereOperator as k };
794
+ export { type CountOptions as C, type DeleteOptions as D, type InsertOptions as I, type JoinSpec as J, type MigrationRecord as M, type OrderBySpec as O, type PoolStats as P, type SelectOptions as S, type TransactionContext as T, type UpsertOptions as U, type WhereClause as W, type Migration as a, type MigrationStatus as b, type MigrationOptions as c, type MigrationResult as d, type TransactionOptions as e, type DatabaseCapabilities as f, type UpdateOptions as g, type TransactionIsolationLevel as h, WHERE_OPERATORS as i, type WhereCondition as j, type WhereOperator as k };
@@ -423,11 +423,33 @@ interface TransactionContext {
423
423
  /**
424
424
  * Update records.
425
425
  *
426
+ * @remarks
427
+ * Built by the adapter rather than by the Drizzle query builder, as `insert`
428
+ * is: the statement writes the columns the PHYSICAL table has, where the
429
+ * pooled `update` writes the ones the runtime model declares. A column the
430
+ * model declares binds through its own encoder, exactly as the query builder
431
+ * binds it; one it does not declare binds the way this adapter's
432
+ * transactional insert binds every value; a key naming no column on the
433
+ * table is a database error rather than a silent drop. A key whose value is
434
+ * `undefined` is not written, `null` is, and an update naming nothing to
435
+ * write is refused.
436
+ *
437
+ * When `options.returning` asks for rows, they come from a read on this
438
+ * transaction, decoded as every read is — the model's view of the row,
439
+ * whatever columns were named. On PostgreSQL and SQLite that read is by the
440
+ * identities the statement reported through RETURNING, so it is exactly the
441
+ * rows this update changed. MySQL has no RETURNING, so there the read
442
+ * re-runs `where`, as it always has on that dialect: an update whose own
443
+ * write falsifies its `where` reads back nothing, and a row another
444
+ * transaction adds under the predicate meanwhile is included. A fenced
445
+ * compare-and-set wants `updateCount` on every dialect.
446
+ *
426
447
  * @param table - Table name
427
- * @param data - Data to update
448
+ * @param data - Data to update, keyed by SQL column name; Drizzle property
449
+ * names are accepted as well
428
450
  * @param where - Conditions for records to update
429
451
  * @param options - Update options
430
- * @returns Updated records (with RETURNING columns if specified)
452
+ * @returns The updated rows when `returning` asked for them, else `[]`
431
453
  */
432
454
  update<T = unknown>(table: string, data: Record<string, unknown>, where: WhereClause, options?: UpdateOptions): Promise<T[]>;
433
455
  /**
@@ -769,4 +791,4 @@ interface MigrationStatus {
769
791
  pending: Migration[];
770
792
  }
771
793
 
772
- export { type CountOptions as C, type DeleteOptions as D, type InsertOptions as I, type JoinSpec as J, type MigrationRecord as M, type OrderBySpec as O, type PoolStats as P, type SelectOptions as S, type TransactionContext as T, type UpdateOptions as U, type WhereClause as W, type Migration as a, type MigrationStatus as b, type MigrationOptions as c, type MigrationResult as d, type UpsertOptions as e, type TransactionOptions as f, type DatabaseCapabilities as g, type TransactionIsolationLevel as h, WHERE_OPERATORS as i, type WhereCondition as j, type WhereOperator as k };
794
+ export { type CountOptions as C, type DeleteOptions as D, type InsertOptions as I, type JoinSpec as J, type MigrationRecord as M, type OrderBySpec as O, type PoolStats as P, type SelectOptions as S, type TransactionContext as T, type UpsertOptions as U, type WhereClause as W, type Migration as a, type MigrationStatus as b, type MigrationOptions as c, type MigrationResult as d, type TransactionOptions as e, type DatabaseCapabilities as f, type UpdateOptions as g, type TransactionIsolationLevel as h, WHERE_OPERATORS as i, type WhereCondition as j, type WhereOperator as k };
@@ -1,6 +1,6 @@
1
- import { D as DrizzleAdapter } from './adapter-C6ENLDau.cjs';
2
- import { M as MigrationRecord, a as Migration, b as MigrationStatus, c as MigrationOptions } from './migration-B6AmjCQ1.cjs';
3
- export { d as MigrationResult } from './migration-B6AmjCQ1.cjs';
1
+ import { D as DrizzleAdapter } from './adapter-Cs3Jl9Fb.cjs';
2
+ import { M as MigrationRecord, a as Migration, b as MigrationStatus, c as MigrationOptions } from './migration-Ce0hkgr_.cjs';
3
+ export { d as MigrationResult } from './migration-Ce0hkgr_.cjs';
4
4
  import 'drizzle-orm';
5
5
  import './core-CVO7WYDj.cjs';
6
6
  import './schema-BDn8WfSL.cjs';
@@ -1,6 +1,6 @@
1
- import { D as DrizzleAdapter } from './adapter-D4GM1VAZ.js';
2
- import { M as MigrationRecord, a as Migration, b as MigrationStatus, c as MigrationOptions } from './migration-R06fsTrz.js';
3
- export { d as MigrationResult } from './migration-R06fsTrz.js';
1
+ import { D as DrizzleAdapter } from './adapter-CHlx_Taa.js';
2
+ import { M as MigrationRecord, a as Migration, b as MigrationStatus, c as MigrationOptions } from './migration-CgoxgWOL.js';
3
+ export { d as MigrationResult } from './migration-CgoxgWOL.js';
4
4
  import 'drizzle-orm';
5
5
  import './core-CVO7WYDj.js';
6
6
  import './schema-BIQ0YQZ_.js';
@@ -1,6 +1,6 @@
1
1
  import { a as SqlParam } from '../core-CVO7WYDj.cjs';
2
2
  export { J as JsonArray, b as JsonObject, c as JsonValue, S as SupportedDialect, T as TableResolver } from '../core-CVO7WYDj.cjs';
3
- export { C as CountOptions, g as DatabaseCapabilities, D as DeleteOptions, I as InsertOptions, J as JoinSpec, a as Migration, c as MigrationOptions, M as MigrationRecord, d as MigrationResult, b as MigrationStatus, O as OrderBySpec, P as PoolStats, S as SelectOptions, T as TransactionContext, h as TransactionIsolationLevel, f as TransactionOptions, U as UpdateOptions, e as UpsertOptions, i as WHERE_OPERATORS, W as WhereClause, j as WhereCondition, k as WhereOperator } from '../migration-B6AmjCQ1.cjs';
3
+ export { C as CountOptions, f as DatabaseCapabilities, D as DeleteOptions, I as InsertOptions, J as JoinSpec, a as Migration, c as MigrationOptions, M as MigrationRecord, d as MigrationResult, b as MigrationStatus, O as OrderBySpec, P as PoolStats, S as SelectOptions, T as TransactionContext, h as TransactionIsolationLevel, e as TransactionOptions, g as UpdateOptions, U as UpsertOptions, i as WHERE_OPERATORS, W as WhereClause, j as WhereCondition, k as WhereOperator } from '../migration-Ce0hkgr_.cjs';
4
4
  export { A as AlterTableOperation, a as AlterTableOptions, b as ColumnDefinition, C as CreateTableOptions, D as DropTableOptions, I as IndexDefinition, c as TableConstraint, T as TableDefinition } from '../schema-BDn8WfSL.cjs';
5
5
  export { a as DatabaseError, D as DatabaseErrorKind, b as DatabaseErrorOptions, c as createDatabaseError, i as isApplicationError, d as isDatabaseError } from '../error-BrdknH2s.cjs';
6
6
  import 'drizzle-orm';
@@ -1,6 +1,6 @@
1
1
  import { a as SqlParam } from '../core-CVO7WYDj.js';
2
2
  export { J as JsonArray, b as JsonObject, c as JsonValue, S as SupportedDialect, T as TableResolver } from '../core-CVO7WYDj.js';
3
- export { C as CountOptions, g as DatabaseCapabilities, D as DeleteOptions, I as InsertOptions, J as JoinSpec, a as Migration, c as MigrationOptions, M as MigrationRecord, d as MigrationResult, b as MigrationStatus, O as OrderBySpec, P as PoolStats, S as SelectOptions, T as TransactionContext, h as TransactionIsolationLevel, f as TransactionOptions, U as UpdateOptions, e as UpsertOptions, i as WHERE_OPERATORS, W as WhereClause, j as WhereCondition, k as WhereOperator } from '../migration-R06fsTrz.js';
3
+ export { C as CountOptions, f as DatabaseCapabilities, D as DeleteOptions, I as InsertOptions, J as JoinSpec, a as Migration, c as MigrationOptions, M as MigrationRecord, d as MigrationResult, b as MigrationStatus, O as OrderBySpec, P as PoolStats, S as SelectOptions, T as TransactionContext, h as TransactionIsolationLevel, e as TransactionOptions, g as UpdateOptions, U as UpsertOptions, i as WHERE_OPERATORS, W as WhereClause, j as WhereCondition, k as WhereOperator } from '../migration-CgoxgWOL.js';
4
4
  export { A as AlterTableOperation, a as AlterTableOptions, b as ColumnDefinition, C as CreateTableOptions, D as DropTableOptions, I as IndexDefinition, c as TableConstraint, T as TableDefinition } from '../schema-BIQ0YQZ_.js';
5
5
  export { a as DatabaseError, D as DatabaseErrorKind, b as DatabaseErrorOptions, c as createDatabaseError, i as isApplicationError, d as isDatabaseError } from '../error-BrdknH2s.js';
6
6
  import 'drizzle-orm';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextlyhq/adapter-drizzle",
3
- "version": "0.0.2-alpha.64",
3
+ "version": "0.0.2-alpha.66",
4
4
  "description": "Shared Drizzle ORM adapter logic for Nextly database adapters",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,8 +52,8 @@
52
52
  "typescript": "^5.9.3",
53
53
  "vite-tsconfig-paths": "^5.1.4",
54
54
  "vitest": "^4.1.0",
55
- "@nextlyhq/eslint-config": "0.0.2-alpha.64",
56
- "@nextlyhq/tsconfig": "0.0.2-alpha.64"
55
+ "@nextlyhq/eslint-config": "0.0.2-alpha.66",
56
+ "@nextlyhq/tsconfig": "0.0.2-alpha.66"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",