orchid-orm 1.5.10 → 1.5.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # orchid-orm
2
2
 
3
+ ## 1.5.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Override column types via callback
8
+ - Updated dependencies
9
+ - pqb@0.9.9
10
+
3
11
  ## 1.5.10
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as pqb from 'pqb';
2
- import { BelongsToRelation, HasManyRelation, HasOneRelation, Db, Adapter, AdapterOptions, QueryLogOptions, NoPrimaryKeyOption, HasAndBelongsToManyRelation, Query, defaultsKey, EmptyObject, BaseRelation, RelationQuery, SetQueryReturnsOne, SetQueryReturnsOneOptional, SetQueryReturnsAll, ColumnTypesBase, ColumnsShape, ColumnShapeOutput, WhereResult, MergeQuery, SetQueryReturns, QueryReturnType } from 'pqb';
2
+ import { BelongsToRelation, HasManyRelation, HasOneRelation, Db, Adapter, AdapterOptions, QueryLogOptions, NoPrimaryKeyOption, HasAndBelongsToManyRelation, Query, defaultsKey, EmptyObject, BaseRelation, RelationQuery, SetQueryReturnsOne, SetQueryReturnsOneOptional, SetQueryReturnsAll, ColumnTypesBase, DefaultColumnTypes, ColumnsShape, ColumnShapeOutput, WhereResult, MergeQuery, SetQueryReturns, QueryReturnType } from 'pqb';
3
3
  export { columnTypes } from 'pqb';
4
4
  import { AppCodeUpdater } from 'rake-db';
5
5
 
@@ -142,7 +142,7 @@ declare type Table = {
142
142
  noPrimaryKey?: boolean;
143
143
  };
144
144
  declare const createBaseTable: <CT extends ColumnTypesBase>(options?: {
145
- columnTypes?: CT | undefined;
145
+ columnTypes?: CT | ((t: DefaultColumnTypes) => CT) | undefined;
146
146
  }) => {
147
147
  new (): {
148
148
  table: string;
package/dist/index.js CHANGED
@@ -33,9 +33,8 @@ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
33
33
  var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
34
34
 
35
35
  const createBaseTable = (options = { columnTypes: pqb.columnTypes }) => {
36
- return create(
37
- options.columnTypes
38
- );
36
+ const ct = typeof options.columnTypes === "function" ? options.columnTypes(pqb.columnTypes) : options.columnTypes;
37
+ return create(ct);
39
38
  };
40
39
  const create = (columnTypes2) => {
41
40
  return class BaseTable {