@xuda.io/xuda-dbs-plugin-xuda 1.0.99 → 1.0.101

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/server.js +1 -1
  3. package/studio.mjs +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
4
4
  "description": "Xuda Database Socket for Xuda's proprietary structure powered by CouchDB",
5
5
  "scripts": {
6
6
  "pub": "npm version patch --force && npm publish --access public"
package/server.js CHANGED
@@ -926,7 +926,7 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
926
926
 
927
927
  return { code: 1, data: body };
928
928
  };
929
-
929
+ var view;
930
930
  if (e.reduce && JSON.parse(e.reduce)) {
931
931
  view = "db_index_reduce";
932
932
  return await runtime_get_query_data();
package/studio.mjs CHANGED
@@ -824,7 +824,7 @@ const query_db = async function (e, db, table_obj) {
824
824
  }
825
825
 
826
826
  try {
827
- const body = await db.query(view, opt);
827
+ const body = await db.query(`xuda/${view}`, opt);
828
828
  if (e.reduce) {
829
829
  let rows = [];
830
830
 
@@ -917,11 +917,11 @@ const query_db = async function (e, db, table_obj) {
917
917
  opt.key = e.table_id;
918
918
  }
919
919
 
920
- const body = await db.query("db_table_counts", opt);
920
+ const body = await db.query("xuda/db_table_counts", opt);
921
921
 
922
922
  return { code: 1, data: body };
923
923
  };
924
-
924
+ var view;
925
925
  if (e.reduce && JSON.parse(e.reduce)) {
926
926
  view = "db_index_reduce";
927
927
  return await runtime_get_query_data();
@@ -1189,7 +1189,7 @@ export const create_design = async (params, resolve, reject) => {
1189
1189
  const db = params.db;
1190
1190
 
1191
1191
  const ddoc = {
1192
- _id: "_design",
1192
+ _id: "_design/xuda",
1193
1193
  views: {
1194
1194
  db_index_reduce: {
1195
1195
  map: 'function(doc) {\r\n if (doc.docType=="database" && doc.stat===3) {\r\n if (doc.udfIndex) {\r\n for (var i = 0; i < doc.udfIndex.length; i++)\r\n {\r\n var val = doc.udfIndex[i]; \r\n emit([val.fileId, val.indexId, val.keyValue],1);\r\n }\r\n }\r\n }\r\n \r\n}',