Skip to content

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

@sepsol

Description

@sepsol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions