mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
chore: adding extra variables to the inline query too
This commit is contained in:
parent
81d99d7813
commit
8cb185b40d
1 changed files with 11 additions and 2 deletions
|
|
@ -55,9 +55,18 @@ export class InlineProcessor extends MarkdownRenderChild {
|
|||
}
|
||||
|
||||
const fileCache = this.app.metadataCache.getFileCache(file);
|
||||
|
||||
// TODO: unify this between codeblock and inline handlers
|
||||
const variables = {
|
||||
...fileCache?.frontmatter ?? {},
|
||||
path: file.path,
|
||||
fileName: file.name,
|
||||
extension: file.extension,
|
||||
}
|
||||
|
||||
const { data, columns } = await this.db.select(
|
||||
transformedQuery.sql,
|
||||
fileCache?.frontmatter ?? {}
|
||||
transformedQuery.sql,
|
||||
variables
|
||||
);
|
||||
|
||||
this.el.empty()
|
||||
|
|
|
|||
Loading…
Reference in a new issue