barklan / inline_sql_syntax

Highlight and lint inline SQL strings.
https://marketplace.visualstudio.com/items?itemName=qufiwefefwoyn.inline-sql-syntax
MIT License
58 stars 25 forks source link

support strings start with more SQL keywords #115

Open zhenyulin opened 11 months ago

zhenyulin commented 11 months ago

It would be nice to support more keywords such as WHERE and use uppercase to avoid confusion. The use case would be for conditional query manipulation, e.g.

    country_filter = "WHERE country = %s" if country else ""

    query = f"""--sql
        SELECT * FROM projects
        {country_filter}
    """
Cheban1996 commented 7 months ago

Also AND OR Example let sql = "AND w.account_id = $2";

gomez-git commented 7 months ago
  1. Fork repo
  2. Update highlight-sql-string.json
  3. Delete previous version from extensions 3.1 Restart extensions (if vscode suggests)
  4. Rebuild extension
  5. Install new version
Bjorn-Eric-Abr commented 5 months ago

Fork repo, update highlight-sql-string.json, delete previous version from extensions, restart extensions (if vscode suggests), rebuild extension and install new version

How would you rebuild it? Tried packaging it with vsce but no luck.

gomez-git commented 5 months ago

Fork repo, update highlight-sql-string.json, delete previous version from extensions, restart extensions (if vscode suggests), rebuild extension and install new version

How would you rebuild it? Tried packaging it with vsce but no luck.

I update engines in package.json to:

    "engines": {
        "vscode": "^1.88.0"
    },

And use this command:

npx vsce package && code --install-extension inline-sql-syntax-2.16.0.vsix

My repo: https://github.com/gomez-git/inline_sql_syntax

Bjorn-Eric-Abr commented 5 months ago

I really like the changes made in that repo, thanks!

I had to change one of the esbuild params since I got an error that the "Extension entrypoint(s) missing." Changed to --outfile=out/extension.js and now it works fine.