diff --git a/CHANGELOG.md b/CHANGELOG.md index de66858..9194d27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/manifest.json b/manifest.json index 8a25dc2..f85ef4e 100644 --- a/manifest.json +++ b/manifest.json @@ -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", diff --git a/package.json b/package.json index 9882b63..84f9663 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/sql/sqlTransformer.ts b/src/sql/sqlTransformer.ts index a112a91..a3ef65e 100644 --- a/src/sql/sqlTransformer.ts +++ b/src/sql/sqlTransformer.ts @@ -12,7 +12,8 @@ export const transformQuery = (query: string, tableNames: Record dialect: 'sqlite', includeSpaces: true, includeComments: true, - includeNewlines: true + includeNewlines: true, + paramTypes: ['@name'] }) const watchTables: string[] = [] diff --git a/src/sql/transformer.test.ts b/src/sql/transformer.test.ts index f6379e8..7a89fd7 100644 --- a/src/sql/transformer.test.ts +++ b/src/sql/transformer.test.ts @@ -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: [] + }) + }) }) \ No newline at end of file diff --git a/versions.json b/versions.json index 8f21459..90c8b5b 100644 --- a/versions.json +++ b/versions.json @@ -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" } \ No newline at end of file