snowflakedb / snowflake-connector-nodejs

NodeJS driver
Apache License 2.0
120 stars 124 forks source link

SNOW-1454926: statement.cancel method isn't available anymore in the latest release #850

Closed matgott closed 1 month ago

matgott commented 3 months ago

Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!

  1. What version of NodeJS driver are you using? 1.11.0

  2. What operating system and processor architecture are you using? Ubuntu 20.04.3 LTS 64bits

  3. What version of NodeJS are you using? node 16.20.2 npm 8.19.4

  4. What are the component versions in the environment (npm list)?

    ├── @automapper/classes@8.8.1
    ├── @automapper/core@8.8.1
    ├── @automapper/nestjs@8.8.1
    ├── @nestjs/axios@0.1.1
    ├── @nestjs/bull@0.6.3
    ├── @nestjs/cache-manager@2.2.2
    ├── @nestjs/cli@9.5.0
    ├── @nestjs/common@9.4.3
    ├── @nestjs/config@2.3.4
    ├── @nestjs/core@9.4.3
    ├── @nestjs/cqrs@9.0.4
    ├── @nestjs/jwt@9.0.0
    ├── @nestjs/platform-express@9.4.3
    ├── @nestjs/schedule@2.2.3
    ├── @nestjs/schematics@9.2.0
    ├── @nestjs/swagger@6.3.0
    ├── @nestjs/terminus@9.2.2
    ├── @nestjs/testing@9.4.3
    ├── @nestjs/typeorm@9.0.1
    ├── @sendgrid/mail@7.7.0
    ├── @types/aws-sdk@2.7.0
    ├── @types/bull@4.10.0
    ├── @types/express@4.17.21
    ├── @types/jest@28.1.8
    ├── @types/multer@1.4.11
    ├── @types/node@16.18.97
    ├── @types/supertest@2.0.16
    ├── @typescript-eslint/eslint-plugin@5.62.0
    ├── @typescript-eslint/parser@5.62.0
    ├── aws-sdk@2.1614.0
    ├── bull@4.12.2
    ├── cache-manager@5.5.2
    ├── class-transformer@0.5.1
    ├── class-validator@0.13.2
    ├── csv-parser@3.0.0
    ├── dotenv@16.4.5
    ├── eslint-config-prettier@8.10.0
    ├── eslint-html-reporter@0.7.4
    ├── eslint-plugin-prettier@4.2.1
    ├── eslint@8.57.0
    ├── fast-json-patch@3.1.1
    ├── jest@28.1.3
    ├── json-2-csv@4.1.1
    ├── mathjs@11.12.0
    ├── moment-fquarter@1.0.0
    ├── moment-timezone@0.5.45
    ├── pg@8.11.5
    ├── prettier@2.8.8
    ├── reflect-metadata@0.1.13
    ├── rimraf@3.0.2
    ├── rxjs@7.8.1
    ├── snowflake-sdk@1.11.0
    ├── source-map-support@0.5.21
    ├── supertest@6.3.4
    ├── swagger-ui-express@4.6.3
    ├── ts-jest@28.0.8
    ├── ts-loader@9.5.1
    ├── ts-node@10.9.2
    ├── tsconfig-paths@4.1.0
    ├── typeorm-naming-strategies@4.1.0
    ├── typeorm@0.3.9
    ├── typescript@4.9.5
    └── winston@3.13.0

5.Server version: xxx

  1. What did you do?

With the previous version I was able to do statement.cancel(). Now with version 1.11.0 cancel method is not available in the Statement types RawStatement | FileAndStageBindStatement

  1. What did you expect to see?

Being able to cancel a statement

matgott commented 3 months ago

Looking at the code I can see that BaseStatement still has the cancel method but the types are not exposing that so using typescript this won't work:

connection.execute({
  sqlText: "",
  binds: [],
  streamResult: true,
  complete: (err, statement) => {
    if (err) statement.cancel(); // I GET TS ERROR Property 'cancel' does not exist
  }
})
sfc-gh-dszmolka commented 3 months ago

hi and thank you for reporting this issue. seems to be a valid concern indeed. we'll fix it.

sfc-gh-dszmolka commented 3 months ago

PR in progress at https://github.com/snowflakedb/snowflake-connector-nodejs/pull/851

sfc-gh-dszmolka commented 2 months ago

PR is now merged and will be part of the next release

sfc-gh-dszmolka commented 1 month ago

released with Snowflake Node.JS driver v1.12.0