drizzle-orm-pg
Advanced tools
Comparing version 0.12.0-beta.15 to 0.12.0-beta.16
@@ -11,3 +11,4 @@ import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types'; | ||
getSQLType(): string; | ||
mapToDriverValue(value: TData): string; | ||
} | ||
export declare function json<TData>(name: string): PgJsonBuilder<TData, ColumnNotNull<false>, ColumnHasDefault<false>>; |
@@ -22,2 +22,5 @@ "use strict"; | ||
} | ||
mapToDriverValue(value) { | ||
return JSON.stringify(value); | ||
} | ||
} | ||
@@ -24,0 +27,0 @@ exports.PgJson = PgJson; |
@@ -11,3 +11,4 @@ import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types'; | ||
getSQLType(): string; | ||
mapToDriverValue(value: TData): string; | ||
} | ||
export declare function jsonb<TData = any>(name: string): PgJsonbBuilder<TData, ColumnNotNull<false>, ColumnHasDefault<false>>; |
@@ -22,2 +22,5 @@ "use strict"; | ||
} | ||
mapToDriverValue(value) { | ||
return JSON.stringify(value); | ||
} | ||
} | ||
@@ -24,0 +27,0 @@ exports.PgJsonb = PgJsonb; |
@@ -32,3 +32,2 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.log({ query, params }); | ||
const result = yield this.client.query({ | ||
@@ -248,4 +247,5 @@ rowMode: 'array', | ||
const valueList = []; | ||
columnKeys.forEach((key) => { | ||
const colValue = value[key]; | ||
columnKeys.forEach((colKey) => { | ||
const colValue = value[colKey]; | ||
const column = columns[colKey]; | ||
if (typeof colValue === 'undefined') { | ||
@@ -255,3 +255,3 @@ valueList.push((0, drizzle_orm_1.sql) `default`); | ||
else { | ||
valueList.push(colValue); | ||
valueList.push(column.mapToDriverValue(colValue)); | ||
} | ||
@@ -258,0 +258,0 @@ }); |
{ | ||
"name": "drizzle-orm-pg", | ||
"version": "0.12.0-beta.15", | ||
"version": "0.12.0-beta.16", | ||
"description": "Drizzle ORM package for PostgreSQL database", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,3 +65,3 @@ import { TableName, Unwrap } from 'drizzle-orm/branded-types'; | ||
}; | ||
where(where: ((aliases: TAliases) => AnyPgSQL<TableName<TJoinedDBTableNames> | TableName<keyof TAliases & string> | GetTableName<TTable>>) | AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>> | undefined): PickWhere<this>; | ||
where(where: ((aliases: TAliases) => AnyPgSQL<TableName<TJoinedDBTableNames> | TableName<keyof TAliases & string> | GetTableName<TTable> | TableName>) | AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable> | TableName> | undefined): PickWhere<this>; | ||
orderBy(columns: (joins: TAliases) => AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>>[] | AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>>): PickOrderBy<this>; | ||
@@ -68,0 +68,0 @@ orderBy(...columns: AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>>[]): PickOrderBy<this>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
203423
2802