@@ -28,6 +28,10 @@ It works on:
2828- Plain ` "…" ` and raw ` r#"…"# ` Rust string literals (sqlx-idiomatic).
2929- Python f-strings (` f"…{x}…" ` ) and ` .format() ` strings (` {{ ` / ` }} `
3030 escapes preserved).
31+ - Go raw / interpreted string literals, including ` fmt.Sprintf ` verbs.
32+ - JavaScript / TypeScript single-, double-, and template-string literals
33+ (` .js ` , ` .ts ` , ` .tsx ` ); ` ${…} ` template substitutions are stripped
34+ before parsing.
3135- Standalone ` .sql ` files (via the LSP).
3236
3337It checks:
@@ -118,8 +122,16 @@ config; the config overrides defaults.
118122schema = " db/schema.sql"
119123directory = " src"
120124dialect = " postgres"
125+ # Or pull the schema from a live database instead of a file:
126+ # db_url = "postgres://user:pass@localhost/mydb"
127+ # db_url = "sqlite:///abs/path/to/db.sqlite"
121128```
122129
130+ Live introspection is feature-gated; the published binary ships with it
131+ on. To validate against a running database without a ` .sql ` file, pass
132+ ` --db-url ` (or set ` db_url ` in the config). Postgres and SQLite are
133+ supported today; MySQL is pending a Rust toolchain bump.
134+
123135Supported dialects: ` generic ` (default), ` postgres ` / ` postgresql ` / ` pg ` ,
124136` mysql ` , ` sqlite ` , ` mssql ` / ` sqlserver ` , ` snowflake ` , ` bigquery ` / ` bq ` ,
125137` redshift ` , ` clickhouse ` , ` duckdb ` , ` hive ` , ` ansi ` . The dialect controls
@@ -134,10 +146,14 @@ The walker prunes `target/`, `.git/`, `node_modules/`, `.venv/`, `venv/`,
134146
135147[ ` sqlshield-lsp ` ] ( sqlshield-lsp/README.md ) is a Language Server that
136148publishes diagnostics for embedded SQL on every ` didOpen ` / ` didChange ` .
137- Any LSP-aware editor (VS Code, Neovim, Helix, Emacs, Zed) can show inline
149+ Any LSP-aware editor (Neovim, Helix, Emacs, Zed, … ) can show inline
138150squiggles on the offending SQL string. The crate's README has the wiring
139151recipes.
140152
153+ A first-party VS Code extension lives at
154+ [ ` editors/vscode/ ` ] ( editors/vscode/README.md ) — it spawns ` sqlshield-lsp `
155+ over stdio and forwards diagnostics as you type.
156+
141157## Python integration
142158
143159[ ` sqlshield-py ` ] ( sqlshield-py/ ) exposes ` validate_query ` and
@@ -176,9 +192,10 @@ errors = sqlshield.validate_query(
176192| Function args / ` CASE ` / ` CAST ` / arithmetic | ✅ |
177193| Case-insensitive identifier matching | ✅ |
178194| 12 SQL dialects via ` --dialect ` | ✅ |
179- | Live database introspection | ✗ |
180- | Quoted-vs-unquoted identifier folding (Postgres rules) | ✗ |
181- | ` MERGE ` | ✗ |
195+ | ` MERGE INTO … USING … WHEN [NOT] MATCHED ` | ✅ |
196+ | Postgres quoted-vs-unquoted identifier folding | ✅ |
197+ | Live database introspection (Postgres + SQLite) | ✅ |
198+ | MySQL live introspection | ✗ |
182199
183200## Limitations
184201
@@ -219,6 +236,10 @@ Workspace layout:
219236- [ ` sqlshield-cli/ ` ] ( sqlshield-cli/ ) — clap-based CLI wrapper.
220237- [ ` sqlshield-py/ ` ] ( sqlshield-py/ ) — PyO3 bindings.
221238- [ ` sqlshield-lsp/ ` ] ( sqlshield-lsp/ ) — ` tower-lsp ` Language Server.
239+ - [ ` sqlshield-introspect/ ` ] ( sqlshield-introspect/ ) — live schema reader
240+ for Postgres and SQLite (consumed by ` --db-url ` ).
241+ - [ ` editors/vscode/ ` ] ( editors/vscode/ ) — first-party VS Code extension
242+ wrapping ` sqlshield-lsp ` .
222243
223244## Similar tools
224245
@@ -233,9 +254,9 @@ Workspace layout:
233254 linter; complementary, not overlapping (squawk lints DDL, sqlshield
234255 lints embedded DML/SELECT).
235256
236- sqlshield's niche: language-agnostic extraction (Python + Rust today,
237- extensible) with a multi-dialect parser, no database connection
238- required.
257+ sqlshield's niche: language-agnostic extraction (Python, Rust, Go, and
258+ JavaScript / TypeScript today, extensible) with a multi-dialect parser,
259+ no database connection required (live introspection optional) .
239260
240261## Contributing
241262
0 commit comments