fix: fixing issue with variables not being properly parsed

This commit is contained in:
Kacper Kula 2025-01-17 22:03:00 +00:00
parent a41076943f
commit f4493a5b75
6 changed files with 21 additions and 4 deletions

View file

@ -1,3 +1,6 @@
# 0.16.1
Fixed issue with variables causing error. Now you can pass variables from your frontmatter with no problem.
# 0.16.0
Now you can query tables in your note and use them as data source! [Check more information in the documentation](http://hypersphere.blog/sql-seal/query-markdown-tables.html).

View file

@ -1,7 +1,7 @@
{
"id": "sqlseal",
"name": "SQLSeal",
"version": "0.16.0",
"version": "0.16.1",
"minAppVersion": "0.15.0",
"description": "Use SQL in your notes to query your vault files and CSV content.",
"author": "hypersphere",

View file

@ -1,6 +1,6 @@
{
"name": "sqlseal",
"version": "0.16.0",
"version": "0.16.1",
"description": "A plugin for Obsidian that allows you to run SQL queries on your notes.",
"main": "main.js",
"scripts": {

View file

@ -12,7 +12,8 @@ export const transformQuery = (query: string, tableNames: Record<string, string>
dialect: 'sqlite',
includeSpaces: true,
includeComments: true,
includeNewlines: true
includeNewlines: true,
paramTypes: ['@name']
})
const watchTables: string[] = []

View file

@ -47,4 +47,16 @@ numbers`
mappedTables: []
})
})
it('should properly transform query with parameters', () => {
const input = `WITH data(a) AS (
VALUES(1),(2),(3),(5),(6),(7)
)
SELECT * FROM data WHERE a >= @test`
expect(transformQuery(input, { files: 'files' })).toEqual({
sql: input,
mappedTables: []
})
})
})

View file

@ -23,5 +23,6 @@
"0.14.0": "0.15.0",
"0.14.1": "0.15.0",
"0.15.0": "0.15.0",
"0.16.0": "0.15.0"
"0.16.0": "0.15.0",
"0.16.1": "0.15.0"
}