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

Serverless support #77

Open
jonatanrdsantos opened this issue Sep 25, 2017 · 1 comment
Open

Serverless support #77

jonatanrdsantos opened this issue Sep 25, 2017 · 1 comment

Comments

@jonatanrdsantos
Copy link

I'm getting this error wen using seriate with aws serverless functions:

TypeError: SqlContext Error. Failed on step "__result__" with: "Cannot read property 'pool' of null"

The class:

import seriate from 'seriate';

export default class SomethingSQLServer {
  constructor() {
    this.seriateService = seriate;
    this.dbconfig = {
      server: process.env.SQL_SERVER_ENDPOINT,
      user: process.env.SQLSERVER_USERNAME,
      password: process.env.SQLSERVER_PASSWORD,
      database: process.env.PRODUCTS_DATABASE,
      requestTimeout: 500000,
    };
    console.log('testing =>', this.dbconfig);
    // this.seriateService.setDefaultConfig(this.dbconfig);
  }

  createSomething(somethingElse) {
    return seriate.execute(this.dbconfig, {
      // stream: true,
      preparedSql: `INSERT INTO SOMETHING.dbo.SOMETHING_TABLE
        (ds_something)
        VALUES (@something)`,
      params: {
        something: {
          val: somethingElse.something,
          type: seriate.NVARCHAR,
        },
      },
    });
  }
  
}

Always i'm getting:

TypeError: SqlContext Error. Failed on step "__result__" with: "Cannot read property 'pool' of null"

Anyone with the same error? Any soluction?

@sharunrajt
Copy link

this issue is due to wrong credentials or server name, please correct it and check.

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

2 participants