ratanakvlun / sequelize-msnodesqlv8 Goto Github PK
View Code? Open in Web Editor NEWSequelize dialect driver for the msnodesqlv8 module
License: ISC License
Sequelize dialect driver for the msnodesqlv8 module
License: ISC License
Hi!
Good job providing this package! Thank you.
By the way, do you know how to establish a trusted connection inside a Linux VM?
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
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 + '"'
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.
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'
})
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.
The latest version is 0.3.1 which apparently has support for node version 8.x.x which we are using. Thanks!
Currently 0.3.2 is in use, 0.5.4 is out and have significant performance improvements.
Hi,
I think version 0.3.1 is not support for Electron 1.7.5.
Please update to 0.3.2.
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"})
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.