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

Tedious v18 includes different TypeScript annotations #971

Closed
Eldjotnar opened this issue Apr 26, 2024 · 6 comments · Fixed by #1041
Closed

Tedious v18 includes different TypeScript annotations #971

Eldjotnar opened this issue Apr 26, 2024 · 6 comments · Fixed by #1041
Assignees
Labels
bug Something isn't working built-in dialect Related to a built-in dialect mssql Related to MS SQL Server (MSSQL) typescript Related to Typescript

Comments

@Eldjotnar
Copy link

Installing the latest version of tedious (18.2.0) will result in a typescript error when creating a new MssqlDialect.

Type 'Connection' is not assignable to type 'TediousConnection | Promise<TediousConnection>'.
  Type 'Connection' is not assignable to type 'TediousConnection'.
    Types of property 'beginTransaction' are incompatible.
      Type '(callback: BeginTransactionCallback, name?: string | undefined, isolationLevel?: number | undefined) => void' is not assignable to type '(callback: (error?: Error | undefined) => void, transactionId?: string | undefined, isolationLevel?: number | undefined) => void'.
        Types of parameters 'callback' and 'callback' are incompatible.
          Types of parameters 'error' and 'err' are incompatible.
            Type 'Error | null | undefined' is not assignable to type 'Error | undefined'.
              Type 'null' is not assignable to type 'Error | undefined'.

If the proposed solution is just to add | null to the definition in mssql-dialect-config.d.ts, I'm happy to open a PR.

@igalklebanov
Copy link
Member

Hey 👋

PRs welcome. You'd also need to bump tedious dev dependency to latest.

@igalklebanov igalklebanov added bug Something isn't working built-in dialect Related to a built-in dialect typescript Related to Typescript mssql Related to MS SQL Server (MSSQL) labels Apr 26, 2024
@mjbergman92
Copy link

I ran into this while trying to get started

@Necrelox
Copy link

@mjbergman92 same 😭 in the meantime I have to downgrade to tedious 16.4.0.

@mjbergman92
Copy link

@Necrelox I reverted back to tedious@17 and I've had no issues so far.

@Necrelox
Copy link

@mjbergman92 I apologize for the late response. Thank you for your feedback!

@zivni
Copy link

zivni commented Jun 19, 2024

Also getting the following when using the example in the getting started guide:

Types of property 'ISOLATION_LEVEL' are incompatible.
    Type '{ [key: string]: number; }' is missing the following properties from type 'TediousIsolationLevel': NO_CHANGE, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, and 2 more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working built-in dialect Related to a built-in dialect mssql Related to MS SQL Server (MSSQL) typescript Related to Typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants