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

hasTable with Schema in mssql #5170

Closed
xJonahS opened this issue May 9, 2022 · 1 comment · Fixed by #5176
Closed

hasTable with Schema in mssql #5170

xJonahS opened this issue May 9, 2022 · 1 comment · Fixed by #5176

Comments

@xJonahS
Copy link

xJonahS commented May 9, 2022

Environment

Knex version: 2.0.0
Database + version: mssql
OS: windows 10

@smorey2

Bug

  1. hasTable does not work with schema (withSchema("NAME")) in mssql. You get an error. The issue seems to be caused by this commit: c4a3abc

The SQL Statement does not filter for the schema anymore and only for the name of the table.
image

This part seems to be missing:
image
(taken from the mysql compiler)

  1. Error message
    Returns false, when it should return true.

  2. Config

const config: Knex.Config = { client: "mssql", connection: { user: process.env.DATABASE_USER, password: process.env.DATABASE_PASSWORD, server: process.env.DATABASE_HOST, port: Number(process.env.DATABASE_PORT), database: process.env.DATABASE_NAME, connectionTimeout: 60000, options: { trustServerCertificate: true, encrypt: true, }, }, };

image
image
image

@kibertoad
Copy link
Collaborator

Released in 2.1.0

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

Successfully merging a pull request may close this issue.

2 participants