inline_sql_syntax icon indicating copy to clipboard operation
inline_sql_syntax copied to clipboard

support strings start with more SQL keywords

Open zhenyulin opened this issue 2 years ago • 5 comments

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}
    """

zhenyulin avatar Dec 12 '23 16:12 zhenyulin

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

Cheban1996 avatar Apr 08 '24 17:04 Cheban1996

  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

gomez-git avatar Apr 13 '24 15:04 gomez-git

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.

Bjorn-Eric-Abr avatar Jun 14 '24 11:06 Bjorn-Eric-Abr

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

gomez-git avatar Jun 14 '24 11:06 gomez-git

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.

Bjorn-Eric-Abr avatar Jun 15 '24 14:06 Bjorn-Eric-Abr