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