pqb 0.27.2 → 0.27.3
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 +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -4843,12 +4843,7 @@ const makeColumnTypes = (schema) => {
|
|
|
4843
4843
|
});
|
|
4844
4844
|
return emptyObject;
|
|
4845
4845
|
}
|
|
4846
|
-
}, makeTimestampsHelpers(
|
|
4847
|
-
makeRegexToFindInSql('\\bupdatedAt\\b"?\\s*='),
|
|
4848
|
-
'"updatedAt"',
|
|
4849
|
-
makeRegexToFindInSql('\\bupdated_at\\b"?\\s*='),
|
|
4850
|
-
'"updated_at"'
|
|
4851
|
-
));
|
|
4846
|
+
}, makeTimestampsHelpers(makeRegexToFindInSql));
|
|
4852
4847
|
};
|
|
4853
4848
|
RawSQL.prototype.columnTypes = makeColumnTypes;
|
|
4854
4849
|
|
|
@@ -10915,12 +10910,14 @@ class Db {
|
|
|
10915
10910
|
const { snakeCase } = options;
|
|
10916
10911
|
for (const key in shape) {
|
|
10917
10912
|
const column = shape[key];
|
|
10913
|
+
column.data.key = key;
|
|
10918
10914
|
if (column.parseFn) {
|
|
10919
10915
|
hasParsers = true;
|
|
10920
10916
|
parsers[key] = column.parseFn;
|
|
10921
10917
|
}
|
|
10922
|
-
|
|
10923
|
-
|
|
10918
|
+
const { modifyQuery: mq } = column.data;
|
|
10919
|
+
if (mq) {
|
|
10920
|
+
modifyQuery = pushOrNewArray(modifyQuery, (q) => mq(q, column));
|
|
10924
10921
|
}
|
|
10925
10922
|
if (column.data.name) {
|
|
10926
10923
|
hasCustomName = true;
|
|
@@ -11001,7 +10998,11 @@ class Db {
|
|
|
11001
10998
|
return toSQL.call(q, options2);
|
|
11002
10999
|
} : toSQL;
|
|
11003
11000
|
this.relations = {};
|
|
11004
|
-
|
|
11001
|
+
if (modifyQuery) {
|
|
11002
|
+
for (const cb of modifyQuery) {
|
|
11003
|
+
cb(this);
|
|
11004
|
+
}
|
|
11005
|
+
}
|
|
11005
11006
|
this.error = class extends QueryError {
|
|
11006
11007
|
constructor(message) {
|
|
11007
11008
|
super(self, message);
|