Skip to content

Commit

Permalink
feat(explorer): wrap table names in double quotes by default (#3588)
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis authored Feb 7, 2025
1 parent 3915759 commit 3067075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/breezy-pandas-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

Table names in SQL queries are now automatically enclosed in double quotes by default, allowing support for special characters.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function Explorer() {
setQuery(`SELECT * FROM "${tableName}";`);
} else {
const columns = Object.keys(table.schema).map((column) => `"${column}"`);
setQuery(`SELECT ${columns.join(", ")} FROM ${tableName};`);
setQuery(`SELECT ${columns.join(", ")} FROM "${tableName}";`);
}
}
}, [chainId, setQuery, selectedTableId, table, worldAddress, prevSelectedTableId, query, indexer.type]);
Expand Down

0 comments on commit 3067075

Please sign in to comment.