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 CHANGED
@@ -4845,12 +4845,7 @@ const makeColumnTypes = (schema) => {
4845
4845
  });
4846
4846
  return orchidCore.emptyObject;
4847
4847
  }
4848
- }, orchidCore.makeTimestampsHelpers(
4849
- makeRegexToFindInSql('\\bupdatedAt\\b"?\\s*='),
4850
- '"updatedAt"',
4851
- makeRegexToFindInSql('\\bupdated_at\\b"?\\s*='),
4852
- '"updated_at"'
4853
- ));
4848
+ }, orchidCore.makeTimestampsHelpers(makeRegexToFindInSql));
4854
4849
  };
4855
4850
  RawSQL.prototype.columnTypes = makeColumnTypes;
4856
4851
 
@@ -10917,12 +10912,14 @@ class Db {
10917
10912
  const { snakeCase } = options;
10918
10913
  for (const key in shape) {
10919
10914
  const column = shape[key];
10915
+ column.data.key = key;
10920
10916
  if (column.parseFn) {
10921
10917
  hasParsers = true;
10922
10918
  parsers[key] = column.parseFn;
10923
10919
  }
10924
- if (column.data.modifyQuery) {
10925
- modifyQuery = orchidCore.pushOrNewArray(modifyQuery, column.data.modifyQuery);
10920
+ const { modifyQuery: mq } = column.data;
10921
+ if (mq) {
10922
+ modifyQuery = orchidCore.pushOrNewArray(modifyQuery, (q) => mq(q, column));
10926
10923
  }
10927
10924
  if (column.data.name) {
10928
10925
  hasCustomName = true;
@@ -11003,7 +11000,11 @@ class Db {
11003
11000
  return toSQL.call(q, options2);
11004
11001
  } : toSQL;
11005
11002
  this.relations = {};
11006
- modifyQuery == null ? void 0 : modifyQuery.forEach((cb) => cb(this));
11003
+ if (modifyQuery) {
11004
+ for (const cb of modifyQuery) {
11005
+ cb(this);
11006
+ }
11007
+ }
11007
11008
  this.error = class extends QueryError {
11008
11009
  constructor(message) {
11009
11010
  super(self, message);