Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support strings start with more SQL keywords #115

Open
zhenyulin opened this issue Dec 12, 2023 · 5 comments
Open

support strings start with more SQL keywords #115

zhenyulin opened this issue Dec 12, 2023 · 5 comments

Comments

@zhenyulin
Copy link

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
Copy link

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

@gomez-git
Copy link

gomez-git commented Apr 13, 2024

  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
Copy link

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
Copy link

gomez-git commented Jun 14, 2024

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants