Giter Club home page Giter Club logo

sequelize-msnodesqlv8's People

Contributors

mokkabonna avatar ratanaklun avatar ratanakvlun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sequelize-msnodesqlv8's Issues

[email protected] - Initialization issue

When I try to instantiate sequelize as given in example

const db = new Sequelize({
dialect: 'mssql',
dialectModulePath: 'sequelize-msnodesqlv8',
dialectOptions: {
driver: 'SQL Server Native Client 11.0',
instanceName: 'xxxxxx',
trustedConnection: true
},
host: 'localhost',
database: 'xxxx'
});

I am getting error message TypeError: Sequelize is not a constructor. I am using Typescript version 2.5

Transaction name not quoted

In: f02a35c#diff-259dec4414a400a6e895f16ff1d0ca3b you removed the quoting of name, this fails when the name is dashed.

This is the query that is executed for me using sequelize ^4.10.0:

SAVE TRANSACTION [10c95e3640360232c791-savepoint-1];
ROLLBACK TRANSACTION [10c95e3640360232c791-savepoint-1];
ROLLBACK TRANSACTION;

And then I get the following error:

SequelizeDatabaseError: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'c95e3640360232c791'

As you can see also the first rollback uses the hypenated name. Something like this should work:

name = '"' + name + '"'

Columns don't populate successfully if data length > 8192

If a column contains data longer than 8192 characters then the resulting object will only contain the last 'packet' of data. This is because the underlying msnodesqlv8 will invoke the 'column' event multiple times with the same column ID but different data, and the previous data inside the rowBuffer array is overwritten.

I have fixed this just by doing (request.js:48):

let existing = rowBuffer[index];

if(existing && existing.metadata.colName === columnMetadata.name && existing.value) {
    existing.value += data;
    return;
}

My apologies for not creating a pull request, but the organisation I work for doesn't allow us to contribute code back to GitHub.

Sequelize is not a constructor

let connection = new Sequelize({
^

TypeError: Sequelize is not a constructor
at Object. (C:\Users\sbpat\Code\emerson-bootcamp\super-hero-repo\models\index.js:10:18)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Users\sbpat\Code\emerson-bootcamp\super-hero-repo\controllers\heroes.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)

let connection = new Sequelize({
dialect: 'mssql',
dialectModulePath: 'sequelize-msnodesqlv8',
dialectOptions: {
driver: 'SQL Server Native Client 10.0',
instanceName: 'LAPTOP-8PISJ86I\SQLEXPRESS',
trustedConnection: true
},
host: 'localhost',
database: 'heroes'
})

Sequelize Connection string issues when there is no instanceName

My companies SQL Server is using the default instance name MSSQLSERVER.
In reviewing an issue I had connecting, I looking in msnodesqlv8/lib/sequelize/connection.js

If I set the instanceName option to MSSQLSERVER it is changed on line 58 to ''. However the connection string builder starting on line 60 is listed as:

config.connectionString = (config.driver ? `Driver={${config.driver}};` : '') +
        `Server=${config.server ? config.server : 'localhost'}\\${config.instanceName};` +
        (config.database ? `Database=${config.database};` : '') +
        (config.trustedConnection ? 'Trusted_Connection=yes;' : `Uid=${config.userName || ''};Pwd=${config.password || ''};`)

However, without an instance name the server is listed as Server=(server)\\; That is incorrect and causes issues. Also, encryption is not built into the connection string builder. I have changed it to the following and it is now working correctly.

config.connectionString = (config.driver ? `Driver={${config.driver}};` : '') +
        `Server=${config.server ? config.server : 'localhost'}` +
        (config.instanceName ? `\\${config.instanceName};` : ';') +
        (config.database ? `Database=${config.database};` : '') +
        (config.trustedConnection ? 'Trusted_Connection=yes;' : `Uid=${config.userName || ''};Pwd=${config.password || ''};`) +
        `Encrypt=${config.encrypt ? 'yes' : 'no'};`

Thank you for your attn to this matter.

Issue installing in ubuntu

Does it not support Linux?

If I run

npm install --save sequelize-msnodesqlv8

I'm getting

npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})

Windows Authentication

Hi guys,

I am not able to use this package. It seems that the trusted connection is not working.

This is my connection:

{
dialect: "mssql",
dialectModulePath: "sequelize-msnodesqlv8",
dialectOptions: {
connectionString: Server=${process.env.TEST_DB_HOSTNAME};Database=${ process.env.TEST_DB_NAME }; Trusted_Connection=yes;
}
}

it does not return any message error but does not open the connection either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.