@dbsp/adapter-pgsql 3.2.0 → 3.2.1
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.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4644,10 +4644,19 @@ function resolveColumnPgType(columnName, ctx) {
|
|
|
4644
4644
|
}
|
|
4645
4645
|
return void 0;
|
|
4646
4646
|
}
|
|
4647
|
+
function resolveColumnAbstractPgBase(columnName, ctx) {
|
|
4648
|
+
if (!ctx.model) return void 0;
|
|
4649
|
+
const table = ctx.model.getTable(ctx.rootTable);
|
|
4650
|
+
if (!table) return void 0;
|
|
4651
|
+
const column = table.columns.find((c) => c.name === columnName);
|
|
4652
|
+
if (!column) return void 0;
|
|
4653
|
+
return mapModelIRTypeToPgBase(column.type);
|
|
4654
|
+
}
|
|
4647
4655
|
var init_utils = __esm({
|
|
4648
4656
|
"src/handlers/where/utils.ts"() {
|
|
4649
4657
|
"use strict";
|
|
4650
4658
|
init_ast_helpers();
|
|
4659
|
+
init_compiler_utils();
|
|
4651
4660
|
init_db_type();
|
|
4652
4661
|
init_param_intent();
|
|
4653
4662
|
init_param_ref();
|
|
@@ -4710,7 +4719,10 @@ var init_any = __esm({
|
|
|
4710
4719
|
typedParam = createTypeCastParamRef(state.paramIndex, columnType, true);
|
|
4711
4720
|
} else {
|
|
4712
4721
|
let pgBaseType;
|
|
4713
|
-
|
|
4722
|
+
const abstractBase = resolveColumnAbstractPgBase(column, ctx);
|
|
4723
|
+
if (abstractBase) {
|
|
4724
|
+
pgBaseType = abstractBase;
|
|
4725
|
+
} else if (decision.dataType) {
|
|
4714
4726
|
pgBaseType = mapModelIRTypeToPgBase(decision.dataType) ?? decision.dataType;
|
|
4715
4727
|
} else {
|
|
4716
4728
|
const sample = values.find((v) => v !== null && v !== void 0);
|