{"id":32123889,"url":"https://github.com/barklan/inline_sql_syntax","last_synced_at":"2026-02-23T04:32:34.823Z","repository":{"id":37752612,"uuid":"430445735","full_name":"barklan/inline_sql_syntax","owner":"barklan","description":"Highlight and lint inline SQL strings.","archived":false,"fork":false,"pushed_at":"2025-12-01T22:06:14.000Z","size":729,"stargazers_count":67,"open_issues_count":47,"forks_count":35,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-04T12:33:35.694Z","etag":null,"topics":["linter","mysql","postgres","sql","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=qufiwefefwoyn.inline-sql-syntax","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barklan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-11-21T18:18:48.000Z","updated_at":"2025-09-17T15:53:36.000Z","dependencies_parsed_at":"2026-01-06T17:11:14.614Z","dependency_job_id":null,"html_url":"https://github.com/barklan/inline_sql_syntax","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/barklan/inline_sql_syntax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barklan%2Finline_sql_syntax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barklan%2Finline_sql_syntax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barklan%2Finline_sql_syntax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barklan%2Finline_sql_syntax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barklan","download_url":"https://codeload.github.com/barklan/inline_sql_syntax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barklan%2Finline_sql_syntax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T02:24:00.660Z","status":"ssl_error","status_checked_at":"2026-02-23T02:22:56.087Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linter","mysql","postgres","sql","vscode","vscode-extension"],"created_at":"2025-10-20T21:24:07.539Z","updated_at":"2026-02-23T04:32:34.814Z","avatar_url":"https://github.com/barklan.png","language":"TypeScript","readme":"# Inline SQL ![shield](https://img.shields.io/visual-studio-marketplace/i/qufiwefefwoyn.inline-sql-syntax)\n\n\u003e Also available in [Open VSX Registry](https://open-vsx.org/extension/qufiwefefwoyn/inline-sql-syntax)\n\n![python](docs/py_lint.png)\n\nHighlight and lint inline SQL strings.\nSupported languages are **Python**, **Go**, **JavaScript**, **TypeScript**, **Ruby**, **Java**, **C#**, **Rust**, **PHP**, **Lua**.\n\nSyntax highlighting works for strings starting with `--sql` or any of\nthe `SELECT`, `INSERT`, `INTO`, `DELETE`, `UPDATE`, `CREATE TABLE`.\n\nAlso works with ES6 Template Strings:\n\n```javascript\nconst query = sql`\n    select * from book;\n`;\n```\n\n**Linting and diagnostics powered entirely by awesome\n[joereynolds/sql-lint](https://github.com/joereynolds/sql-lint) and works for\nmultiline strings that start with either \u003ccode\u003e\\`--sql\u003c/code\u003e (backtick followed by `--sql`),\n`\"--sql` or `\"\"\"--sql`.**\n\n## Contributors\n\n\u003c!-- readme: contributors -start --\u003e\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/jwhitaker-swiftnav\"\u003e\n            \u003cimg src=\"https://avatars.githubusercontent.com/u/113399675?v=4\" width=\"100;\" alt=\"jwhitaker-swiftnav\"/\u003e\n            \u003cbr /\u003e\n            \u003csub\u003e\u003cb\u003ejwhitaker-swiftnav\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/Wild-W\"\u003e\n            \u003cimg src=\"https://avatars.githubusercontent.com/u/39774593?v=4\" width=\"100;\" alt=\"Wild-W\"/\u003e\n            \u003cbr /\u003e\n            \u003csub\u003e\u003cb\u003eConnor Bren\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/tamasfe\"\u003e\n            \u003cimg src=\"https://avatars.githubusercontent.com/u/25967296?v=4\" width=\"100;\" alt=\"tamasfe\"/\u003e\n            \u003cbr /\u003e\n            \u003csub\u003e\u003cb\u003eFerenc Tamás\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/nossrannug\"\u003e\n            \u003cimg src=\"https://avatars.githubusercontent.com/u/416906?v=4\" width=\"100;\" alt=\"nossrannug\"/\u003e\n            \u003cbr /\u003e\n            \u003csub\u003e\u003cb\u003eGunnar Sv Sigurbjörnsson\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/JonathanWolfe\"\u003e\n            \u003cimg src=\"https://avatars.githubusercontent.com/u/1449779?v=4\" width=\"100;\" alt=\"JonathanWolfe\"/\u003e\n            \u003cbr /\u003e\n            \u003csub\u003e\u003cb\u003eJon Wolfe\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/titouancreach\"\u003e\n            \u003cimg src=\"https://avatars.githubusercontent.com/u/3995719?v=4\" width=\"100;\" alt=\"titouancreach\"/\u003e\n            \u003cbr /\u003e\n            \u003csub\u003e\u003cb\u003eTitouan CREACH\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n    \u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003c!-- readme: contributors -end --\u003e\n\n## Safety\n\nThe proper way to sanitize data for insertion into your database is to\nuse placeholders for all variables to be inserted into your SQL strings.\nIn other words, NEVER do this (Python example):\n\n```python\nquery = f\"INSERT INTO foo (bar, baz) VALUES ( {variable1}, {variable2} )\";\n```\n\nInstead, use `$` placeholders (or `?` in some databases):\n\n```python\nquery = \"INSERT INTO foo (bar, baz) VALUES ( $1, $2  )\";\n```\n\nAnd then pass the variables to be replaced when you execute the query.\nFor example with [pgx](https://github.com/JackC/pgx) (Go example):\n\n```go\nerr = conn.QueryRow(\n    context.Background(),\n    \"select name, weight from widgets where id=$1\",\n    42,\n).Scan(\u0026name, \u0026weight)\n```\n\n## Integration with real database\n\nIntegration with real database is available and controlled through VSCode options:\n\n```json\n{\n    \"inlineSQL.enableDBIntegration\": true,\n    \"inlineSQL.dbDriver\": \"postgres\",\n    \"inlineSQL.dbHost\": \"localhost\",\n    \"inlineSQL.dbPort\": 5432,\n    \"inlineSQL.dbUser\": \"postgres\",\n    \"inlineSQL.dbPassword\": \"postgres\"\n}\n```\n\n## Examples\n\n### Python\n\n![python](docs/py_lint.png)\n\n### JavaScript/TypeScript\n\n![js](docs/js_lint.png)\n\n### Go\n\n![go](docs/go_lint.png)\n\n![go](docs/go_lint2.png)\n\n\u003ctable style=\"width:100%; border: none!important;\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ePython\u003c/td\u003e\n    \u003ctd\u003eJavaScript/TypeScript\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"docs/python.png\" /\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"docs/js.png\" /\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable style=\"width:100%; border: none!important;\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRuby\u003c/td\u003e\n    \u003ctd\u003eJava\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"docs/ruby.png\" /\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"docs/java.png\" /\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Limitations\n\n### Semantic highlighting\n\nHighlighting does not work with semantic token highlighting enabled (feature provided by some LSP servers).\n\nCurrently gopls semantic token highlighting (option `gopls.ui.semanticTokens` - off by default)\noverrides extension's syntax.\n\n#### gopls\n\n```json\n{\n    \"gopls.ui.semanticTokens\": false\n}\n```\n\n#### rust-analyzer\n\n```json\n{\n    \"rust-analyzer.highlighting.strings\": false\n}\n```\n\n#### `C#`\n\n```json\n{\n    \"csharp.semanticHighlighting.enabled\": false\n}\n```\n\n## Motivation\n\nThis small extension is meant to help those who don't use ORM and don't like SQL builders\nlike [squirrel](https://github.com/Masterminds/squirrel),\nbut still want inline sql in their code to be something more than magic strings,\nhelping to avoid small bugs and typos almost instantly.\n\n## Related\n\n- [joereynolds/sql-lint](https://github.com/joereynolds/sql-lint) - Used for linting.\n- [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server) - SQL Language Server, consider it if you use separate files for sql.\n- [cmoog/vscode-sql-notebook](https://github.com/cmoog/vscode-sql-notebook) - Open SQL files as VSCode Notebooks.\n- [pushqrdx/vscode-inline-html](https://github.com/pushqrdx/vscode-inline-html) - ES6 Template Strings inline HTML.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarklan%2Finline_sql_syntax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarklan%2Finline_sql_syntax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarklan%2Finline_sql_syntax/lists"}