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

False errors: relation "x" does not exist #209

Open
sepsol opened this issue Apr 20, 2022 · 0 comments
Open

False errors: relation "x" does not exist #209

sepsol opened this issue Apr 20, 2022 · 0 comments

Comments

@sepsol
Copy link

sepsol commented Apr 20, 2022

I'm using sql-lint through(?) Inline SQL VS Code extension. I added the configuration to make it establish a connection to my postgres database like so:

{
  "inlineSQL.dbDriver": "postgres",
  "inlineSQL.dbHost": "localhost",
  "inlineSQL.dbPort": 5432,
  "inlineSQL.dbUser": "docker",
  "inlineSQL.dbPassword": "docker",
  "inlineSQL.enableDBIntegration": true,
  "inlineSQL.lintSQLFiles": false
}

I wrote a test query in my javascript file like so:

const x = `--sql 
  SELECT * FROM accounts;
`;

But it's giving me this error:

[error] relation "accounts" does not exist

Whereas I know for a fact and confirmed that that relation did exist.

--

One thing that I suspect that is causing this issue is that in my postgres connection port, I host 4 different databases. Since I wasn't able to specify the exact database that I want the linter to connect to, I think the linter is not able to find the correct database by itself.

So, if this is valid, could you please add the feature to be able to specify the name of the database in the linter config file so that it can also be adopted by the extension specified above?

Thanks in advance

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

1 participant