Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 97047dc

Browse files
committed
Merge branch '531-bug-problem-with-dataview-query-without-any-column-informed'
2 parents d9fbab6 + 633ae39 commit 97047dc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/helpers/QueryHelper.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ import { LOGGER } from "services/Logger";
44

55
export function generateDataviewTableQuery(columns: TableColumn[], fromQuery: string): string {
66
LOGGER.info('generateDataviewTableQuery');
7-
const query = `TABLE ${columns
7+
// User columns
8+
const keyArrays = columns
89
.filter((col) => !col.isMetadata)
9-
.map((col) => `${col.key}`)
10-
.join(",")},${DatabaseCore.DATAVIEW_FILE},${DatabaseCore.FRONTMATTER_KEY} ${fromQuery}`;
10+
.map((col) => `${col.key}`);
11+
// Plugin special columns
12+
keyArrays.push(DatabaseCore.DATAVIEW_FILE);
13+
keyArrays.push(DatabaseCore.FRONTMATTER_KEY);
14+
15+
const query = `TABLE ${keyArrays.join(',')} ${fromQuery}`;
1116
LOGGER.info(`DV query of the source: ${query}`);
1217
return query;
1318
}

0 commit comments

Comments
 (0)