pqb 0.27.4 → 0.27.6

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
@@ -1426,8 +1426,9 @@ const processJoinArgs = (joinTo, first, args, joinSubQuery) => {
1426
1426
  };
1427
1427
  const makeJoinQueryBuilder = (joinedQuery, joinedShapes, joinTo) => {
1428
1428
  const q = joinedQuery.baseQuery.clone();
1429
- q.q.joinedShapes = joinedShapes;
1430
1429
  q.baseQuery = q;
1430
+ q.q.as = joinedQuery.q.as;
1431
+ q.q.joinedShapes = joinedShapes;
1431
1432
  q.q.joinTo = joinTo;
1432
1433
  return q;
1433
1434
  };
@@ -1850,6 +1851,7 @@ const pushEntry = (input, start, pos, entries, item) => {
1850
1851
 
1851
1852
  const parseDateToNumber = (value) => value ? Date.parse(value) : value;
1852
1853
  const parseDateToDate = (value) => value ? new Date(value) : value;
1854
+ parseDateToNumber.hideFromCode = parseDateToDate.hideFromCode = true;
1853
1855
  const defaultSchemaConfig = {
1854
1856
  parse(fn) {
1855
1857
  return Object.assign(Object.create(this), {
@@ -6045,12 +6047,15 @@ const _queryCreateMany = (q, data) => {
6045
6047
  };
6046
6048
  const _queryInsertMany = (q, data) => {
6047
6049
  const ctx = createCtx();
6048
- return insert(
6050
+ let result = insert(
6049
6051
  q,
6050
6052
  handleManyData(q, data, ctx),
6051
6053
  "object",
6052
6054
  true
6053
6055
  );
6056
+ if (!data.length)
6057
+ result = result.none();
6058
+ return result;
6054
6059
  };
6055
6060
  const _queryCreateRaw = (q, args) => {
6056
6061
  createSelect(q);
@@ -10719,7 +10724,7 @@ class QueryMethods {
10719
10724
  * ```
10720
10725
  */
10721
10726
  none() {
10722
- return extendQuery(this, noneMethods);
10727
+ return this.then === noneMethods.then ? this : extendQuery(this, noneMethods);
10723
10728
  }
10724
10729
  /**
10725
10730
  * `modify` allows modifying the query with your function: