goby-database 2.2.27 → 2.2.28
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 +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -895,8 +895,8 @@ export default class Project {
|
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
897
|
let orderby = `ORDER BY ${class_string}.system_order`;
|
|
898
|
-
const data_prop_sql_string = data_properties.map((p) => `[user_${p.name}]`).join(',');
|
|
899
|
-
const table_selection = pagination.property_range == 'all' ? `[class_${class_name}].*` : `system_id,system_order
|
|
898
|
+
const data_prop_sql_string = data_properties.length > 0 ? ', ' + data_properties.map((p) => `[user_${p.name}]`).join(',') : '';
|
|
899
|
+
const table_selection = pagination.property_range == 'all' ? `[class_${class_name}].*` : `system_id,system_order${data_prop_sql_string}`;
|
|
900
900
|
let filter_by_items = '';
|
|
901
901
|
if (pagination.item_range && pagination.item_range !== 'all') {
|
|
902
902
|
filter_by_items = `WHERE system_id in (${pagination.item_range.join(',')})`;
|
|
@@ -910,6 +910,7 @@ export default class Project {
|
|
|
910
910
|
${cte_joins.join(' ')}
|
|
911
911
|
${filter_by_items}
|
|
912
912
|
${orderby}`;
|
|
913
|
+
console.log('query', query);
|
|
913
914
|
// possibly elaborate this any type a little more in the future, e.g. a CellValue or SQLCellValue type that expects some wildcards
|
|
914
915
|
let items = this.db.prepare(query).all();
|
|
915
916
|
let stringified_properties = class_data.properties.filter(a => a.type == 'relation' || can_have_multiple_values(a.max_values));
|