spice-js 2.6.76 → 2.6.78

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.
@@ -66,7 +66,7 @@ class SpiceModel {
66
66
 
67
67
  var Database = require("spice-" + dbtype);
68
68
 
69
- this[_mapping_dept] = ((_args2 = args) == null ? void 0 : (_args2$args = _args2.args) == null ? void 0 : _args2$args.mapping_dept) || 100;
69
+ this[_mapping_dept] = ((_args2 = args) == null ? void 0 : (_args2$args = _args2.args) == null ? void 0 : _args2$args.mapping_dept) || 2;
70
70
  this[_mapping_dept_exempt] = ((_args3 = args) == null ? void 0 : (_args3$args = _args3.args) == null ? void 0 : _args3$args.mapping_dept_exempt) || [];
71
71
  this.type = "";
72
72
  this.collection = args.connection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-js",
3
- "version": "2.6.76",
3
+ "version": "2.6.78",
4
4
  "description": "spice",
5
5
  "main": "build/index.js",
6
6
  "repository": {
@@ -52,7 +52,7 @@ export default class SpiceModel {
52
52
  var dbtype =
53
53
  spice.config.database.connections[args.connection].type || "couchbase";
54
54
  let Database = require(`spice-${dbtype}`);
55
- this[_mapping_dept] = args?.args?.mapping_dept || 100;
55
+ this[_mapping_dept] = args?.args?.mapping_dept || 2;
56
56
  this[_mapping_dept_exempt] = args?.args?.mapping_dept_exempt || [];
57
57
  this.type = "";
58
58
  this.collection = args.connection;
@@ -1628,6 +1628,14 @@ export default class SpiceModel {
1628
1628
  parseRequestedColumns(columns) {
1629
1629
  if (!columns || columns === "") return null;
1630
1630
 
1631
+ // Handle array of columns (convert to string)
1632
+ if (Array.isArray(columns)) {
1633
+ columns = columns.join(",");
1634
+ }
1635
+
1636
+ // Must be a string to parse
1637
+ if (typeof columns !== "string") return null;
1638
+
1631
1639
  // Extract field names from column specifications
1632
1640
  // Handles: "field", "`field`", "table.field", "`table`.`field`", "expr AS alias"
1633
1641
  const fields = new Set();