mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
Merge pull request #54 from h-sphere/fix/parsing-errors
fix: added logging for parser errors
This commit is contained in:
commit
e9bee3d329
6 changed files with 27 additions and 8 deletions
|
|
@ -1,3 +1,6 @@
|
|||
# 0.19.1 (2025-01-27)
|
||||
Added logging for unprocessable data to help reporting.
|
||||
|
||||
# 0.19.0 (2025-01-24)
|
||||
Adding support for JSON and JSON5 files. You can now query these data types and create tables based on them. You can use JSONPath to traverse the JSON files and extract data from it. [See more in the documentation](http://hypersphere.blog/sql-seal/data-sources/json-and-json5.html).
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "sqlseal",
|
||||
"name": "SQLSeal",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Use SQL in your notes to query your vault files and CSV content.",
|
||||
"author": "hypersphere",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "sqlseal",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"description": "A plugin for Obsidian that allows you to run SQL queries on your notes.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -11,11 +11,19 @@ export const displayError= (el: HTMLElement, text: string) => {
|
|||
}
|
||||
|
||||
export const parseCell = (data: string, app: App) => {
|
||||
if (data && typeof data === 'string' && data.startsWith('SQLSEALCUSTOM')) {
|
||||
const parsedData = JSON.parse(data.slice('SQLSEALCUSTOM('.length, -1))
|
||||
return renderSqlSealCustomElement(parsedData, app)
|
||||
}
|
||||
return data
|
||||
try {
|
||||
if (data && typeof data === 'string' && data.startsWith('SQLSEALCUSTOM')) {
|
||||
const parsedData = JSON.parse(data.slice('SQLSEALCUSTOM('.length, -1))
|
||||
return renderSqlSealCustomElement(parsedData, app)
|
||||
}
|
||||
return data
|
||||
} catch (e) {
|
||||
console.error('Error parsing cell with data:', data, e)
|
||||
return createDiv({
|
||||
text: 'Parsing error',
|
||||
cls: 'sqlseal-parse-error'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
type SqlSealAnchorElement = {
|
||||
|
|
|
|||
|
|
@ -133,4 +133,11 @@
|
|||
|
||||
.sqlseal-list.show-column-names .sqlseal-list-element-single .sqlseal-column-name {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.sqlseal-parse-error {
|
||||
background: #b80f0f;
|
||||
color: #FFF;
|
||||
padding: 0.2em;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
|
@ -28,5 +28,6 @@
|
|||
"0.17.0": "0.15.0",
|
||||
"0.18.0": "0.15.0",
|
||||
"0.18.1": "0.15.0",
|
||||
"0.19.0": "0.15.0"
|
||||
"0.19.0": "0.15.0",
|
||||
"0.19.1": "0.15.0"
|
||||
}
|
||||
Loading…
Reference in a new issue