imodel-pg 0.15.0 → 0.15.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/index.d.mts +1 -1
- package/index.mjs +9 -7
- package/package.json +1 -1
package/index.d.mts
CHANGED
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* imodel v0.15.
|
|
2
|
+
* imodel v0.15.1
|
|
3
3
|
* (c) 2019-2026 undefined
|
|
4
4
|
* @license undefined
|
|
5
5
|
*/
|
|
@@ -874,11 +874,13 @@ function insertSql(env, table, columns, list, keys, conflict, conflictSet) {
|
|
|
874
874
|
const setList = conflictSet && typeof conflictSet === 'object' ? getSet(conflictSet, columns, env) : [];
|
|
875
875
|
if (fields?.length) {
|
|
876
876
|
conflictSql = Sql(['ON CONFLICT (', ...Array(fields.length - 1).fill(','), ')'], ...fields.map(f => Sql.Field(f)));
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
877
|
+
if (!setList.length) {
|
|
878
|
+
for (const f of key) {
|
|
879
|
+
if (fields.includes(f)) {
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
setList.push(Sql`${Sql.Field(f)} = EXCLUDED.${Sql.Field(f)}`);
|
|
880
883
|
}
|
|
881
|
-
setList.push(Sql`${Sql.Field(f)} = EXCLUDED.${Sql.Field(f)}`);
|
|
882
884
|
}
|
|
883
885
|
} else {
|
|
884
886
|
conflictSql = Sql`ON CONFLICT`;
|
|
@@ -1819,8 +1821,8 @@ function index (pool, version) {
|
|
|
1819
1821
|
return '';
|
|
1820
1822
|
}
|
|
1821
1823
|
},
|
|
1822
|
-
insert(env, table, columns, data, keys) {
|
|
1823
|
-
return query(env, insertSql(env, table, columns, data, keys));
|
|
1824
|
+
insert(env, table, columns, data, keys, ignore) {
|
|
1825
|
+
return query(env, insertSql(env, table, columns, data, keys, ignore));
|
|
1824
1826
|
},
|
|
1825
1827
|
upsert(env, table, columns, data, keys, conflict, conflictSet) {
|
|
1826
1828
|
return query(env, insertSql(env, table, columns, data, keys, conflict, conflictSet));
|