pqb 0.4.8 → 0.4.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pqb",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Postgres query builder",
5
5
  "homepage": "https://porm.netlify.app/guide/query-builder.html",
6
6
  "repository": {
@@ -46,6 +46,7 @@ export type ColumnData = {
46
46
  compression?: string;
47
47
  foreignKey?: ForeignKey<string, string[]>;
48
48
  modifyQuery?: (q: Query) => void;
49
+ as?: ColumnType;
49
50
  };
50
51
 
51
52
  type ForeignKeyMatch = 'FULL' | 'PARTIAL' | 'SIMPLE';
@@ -224,8 +225,8 @@ export abstract class ColumnType<
224
225
  as<
225
226
  T extends ColumnType,
226
227
  C extends ColumnType<T['type'], Operators, T['inputType']>,
227
- >(this: T, _: C) {
228
- return this as unknown as C;
228
+ >(this: T, column: C): C {
229
+ return addColumnData(this, 'as', column) as unknown as C;
229
230
  }
230
231
 
231
232
  toSQL() {