orchid-orm 1.78.1 → 1.78.2

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.mjs CHANGED
@@ -343,11 +343,11 @@ const createTableFactory = (options) => {
343
343
  id,
344
344
  table,
345
345
  nameInDb,
346
- schema: tableOptions?.schema,
347
- noPrimaryKey: tableOptions?.noPrimaryKey,
346
+ schema: tableOptions?.schema ?? options?.schema,
347
+ noPrimaryKey: tableOptions?.noPrimaryKey ?? options?.noPrimaryKey,
348
348
  snakeCase,
349
349
  comment: tableOptions?.comment,
350
- generatorIgnore: tableOptions?.generatorIgnore,
350
+ generatorIgnore: tableOptions?.generatorIgnore ?? options?.generatorIgnore,
351
351
  readOnly: tableOptions?.readOnly,
352
352
  columns: {
353
353
  shape,
@@ -460,6 +460,10 @@ const createTableFactory = (options) => {
460
460
  defineTable.nowSQL = options?.nowSQL;
461
461
  defineTable.snakeCase = options?.snakeCase;
462
462
  defineTable.language = options?.language;
463
+ defineTable.extend = (extendedOptions) => createTableFactory({
464
+ ...options,
465
+ ...extendedOptions
466
+ }).defineTable;
463
467
  const defineView = ((name, optionsOrT, maybeT) => {
464
468
  const viewOptions = typeof optionsOrT === "function" ? void 0 : optionsOrT;
465
469
  const materialized = viewOptions?.materialized;
@@ -2755,6 +2759,7 @@ const privateOrchidORMWithAdapter = ({ log, logger, autoPreparedStatements, noPr
2755
2759
  $withRecursive: qb.withRecursive.bind(qb),
2756
2760
  $withSql: qb.withSql.bind(qb),
2757
2761
  $from: qb.from.bind(qb),
2762
+ $select: ((selection) => qb.select(selection).take()),
2758
2763
  $close: adapter.close.bind(adapter),
2759
2764
  $withOptions: qb.withOptions.bind(qb)
2760
2765
  };