pqb 0.1.0 → 0.1.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.d.ts CHANGED
@@ -1205,9 +1205,11 @@ declare const createDb: <CT extends ColumnTypesBase = {
1205
1205
  }) => Type)) => JSONColumn<Type>;
1206
1206
  jsonText: () => JSONTextColumn;
1207
1207
  array: <Item extends ColumnType<unknown, Operators, unknown>>(item: Item) => ArrayColumn<Item>;
1208
- timestamps: () => {
1209
- createdAt: TimestampColumn<undefined>;
1210
- updatedAt: TimestampColumn<undefined>;
1208
+ timestamps<T_14 extends ColumnType<unknown, Operators, unknown>>(this: {
1209
+ timestamp(): T_14;
1210
+ }): {
1211
+ createdAt: T_14;
1212
+ updatedAt: T_14;
1211
1213
  };
1212
1214
  primaryKey(columns: string[], options?: {
1213
1215
  name?: string | undefined;
@@ -4234,9 +4236,11 @@ declare const columnTypes: {
4234
4236
  json: <Type extends JSONTypeAny>(schemaOrFn: Type | ((j: JSONTypes) => Type)) => JSONColumn<Type>;
4235
4237
  jsonText: () => JSONTextColumn;
4236
4238
  array: <Item extends ColumnType<unknown, Operators, unknown>>(item: Item) => ArrayColumn<Item>;
4237
- timestamps: () => {
4238
- createdAt: TimestampColumn<undefined>;
4239
- updatedAt: TimestampColumn<undefined>;
4239
+ timestamps<T_1 extends ColumnType<unknown, Operators, unknown>>(this: {
4240
+ timestamp(): T_1;
4241
+ }): {
4242
+ createdAt: T_1;
4243
+ updatedAt: T_1;
4240
4244
  };
4241
4245
  primaryKey(columns: string[], options?: {
4242
4246
  name?: string;
package/dist/index.esm.js CHANGED
@@ -1872,10 +1872,12 @@ const columnTypes = {
1872
1872
  json: (schemaOrFn) => new JSONColumn(schemaOrFn),
1873
1873
  jsonText: () => new JSONTextColumn(),
1874
1874
  array: (item) => new ArrayColumn(item),
1875
- timestamps: () => ({
1876
- createdAt: new TimestampColumn().default(raw("now()")),
1877
- updatedAt: new TimestampColumn().default(raw("now()"))
1878
- }),
1875
+ timestamps() {
1876
+ return {
1877
+ createdAt: this.timestamp().default(raw("now()")),
1878
+ updatedAt: this.timestamp().default(raw("now()"))
1879
+ };
1880
+ },
1879
1881
  primaryKey(columns, options) {
1880
1882
  tableData.primaryKey = { columns, options };
1881
1883
  return emptyObject;