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

Please update documents with the latest config schema #858

Closed
yianni-ververis opened this issue Feb 2, 2019 · 5 comments
Closed

Please update documents with the latest config schema #858

yianni-ververis opened this issue Feb 2, 2019 · 5 comments

Comments

@yianni-ververis
Copy link

This is the warning I get by using the examples in the repository.

tedious deprecated The "config.userName" property is deprecated and future tedious versions will no longer support it. Please switch to using the new "config.authentication" property instead. src/server/models/utilities/AzureSQL.js:36:25

Please update documents with the latest config schema that uses "config.authentication"

@Hadis-Knj
Copy link

Hadis-Knj commented Feb 4, 2019

@yianni-ververis the document about new config options is updated in http://tediousjs.github.io/tedious/api-connection.html any feedback to make it better is deeply welcomed 🙏

@pranaytanniru
Copy link

hey, there is no example regarding how a config object should look like.

@arthurschreiber
Copy link
Collaborator

arthurschreiber commented Feb 8, 2019

@pranaytanniru It's a bit of a shortcoming of the current documentation.

Here's an example config that makes use of the authentication property:

{
  "server": "localhost",
  "authentication": {
    "type": "default",
    "options": {
      "userName": "sa",
      "password": "yourStrong(!)Password",
    }
  },
  "options": {
    "port": 1433,
    "database": "master"
  }
}

@csharpsi
Copy link

I didn't get any error message except login failed for user ''

I was using Typescript and it turns out that the @types/tedious definition was out of date and didn't include an interface definition for the authentication object. I've submitted a PR to the DefinitelyTyped project to resolve this.

@IanChokS
Copy link
Member

IanChokS commented Aug 8, 2019

For a full list of the connection configuration options, you can check out the constructor that sets the configuration object under tedious/src/connection.js.

E.g.,

const authentication = {
        type: 'default',
        options: {
          userName: ...,
          password: ...
        }
      };

const config = {
      server: config.server,
      authentication: authentication,
      options: {
        abortTransactionOnError: false,
        appName: undefined,
        camelCaseColumns: false,
        cancelTimeout: DEFAULT_CANCEL_TIMEOUT,
        columnNameReplacer: undefined,
        connectionRetryInterval: DEFAULT_CONNECT_RETRY_INTERVAL,
        connectTimeout: DEFAULT_CONNECT_TIMEOUT,
        connectionIsolationLevel: ISOLATION_LEVEL.READ_COMMITTED,
        cryptoCredentialsDetails: {},
        database: undefined,
        datefirst: DEFAULT_DATEFIRST,
        dateFormat: DEFAULT_DATEFORMAT,
        debug: {
          data: false,
          packet: false,
          payload: false,
          token: false
        },
        enableAnsiNull: true,
        enableAnsiNullDefault: true,
        enableAnsiPadding: true,
        enableAnsiWarnings: true,
        enableArithAbort: false,
        enableConcatNullYieldsNull: true,
        enableCursorCloseOnCommit: null,
        enableImplicitTransactions: false,
        enableNumericRoundabort: false,
        enableQuotedIdentifier: true,
        encrypt: false,
        fallbackToDefaultDb: false,
        instanceName: undefined,
        isolationLevel: ISOLATION_LEVEL.READ_COMMITTED,
        language: DEFAULT_LANGUAGE,
        localAddress: undefined,
        maxRetriesOnTransientErrors: 3,
        multiSubnetFailover: false,
        packetSize: DEFAULT_PACKET_SIZE,
        port: DEFAULT_PORT,
        readOnlyIntent: false,
        requestTimeout: DEFAULT_CLIENT_REQUEST_TIMEOUT,
        rowCollectionOnDone: false,
        rowCollectionOnRequestCompletion: false,
        tdsVersion: DEFAULT_TDS_VERSION,
        textsize: DEFAULT_TEXTSIZE,
        trustServerCertificate: true,
        useColumnNames: false,
        useUTC: true
      }
    };

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

6 participants