tedious

DateTime conversion failed with sequelise inserting a SQL Server record

人盡茶涼 提交于 2019-12-25 05:43:08
问题 When adding a new record into my database I get the error: Conversion failed when converting date and/or time from character string The datetime it tries to insert is: 2015-10-05 21:43:57.000 +00:00 It seems that Sequelise also inserts the timezone. I tried setting the "timezone" to an empty string but this didn't help. How can I insert a valid SQL Server DATETIME with sequelize? Model: RegDate : { type : Tedious.TYPES.DateTime, defaultValue: Sequelize.NOW } 回答1: Change the Column data type

Requests can only be made in the LoggedIn state, not the Connecting state

99封情书 提交于 2019-12-25 01:53:20
问题 I am trying to connect to SQL Server (2016) using the "tedious" javascript library - I see a few of us had the same issue but not many of them had the question resolved - can you'll please let me know what I am doing wrong here? To give a background in short, I am spinning up my ApolloServer ( GraphQL - ) to build my schemas and have apollo server talk to my SQL Server and display it on my front end using apollo client. I am able to get my ApolloServer running - but when I try to connect to

How to set application name in sequelize connection object?

淺唱寂寞╮ 提交于 2019-12-12 09:54:43
问题 Summary: I want to change the application name of the connection string when initialize a new sequalize object. based on this stackoverflow question, I set the appName of dialectOptions as follows: let conn = new Sequelize(this.models.sequelize.config.database, this.models.sequelize.config.username, this.models.sequelize.config.password, { host: this.models.sequelize.config.host, dialect: this.models.sequelize.getDialect(), dialectOptions: { appName: "userid=-2@gid=" + gid } }); Question:

Depreciation warning does not allow deploying an Application on AZURE,

限于喜欢 提交于 2019-12-11 17:59:03
问题 I get the following warning while deploying my application to AZURE. (node:6568) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead. But this does not allow my application to start. Azure logs show the following thing: PATH OF LOGS: D:\home\LogFiles\Application> 回答1: I know this question is already 8 month old, but just for completeness I am going to provide the answer on how to suppress warnings for Node in Azure. There is actually multiple ways

npm install just do nothing on Kudu

孤街醉人 提交于 2019-12-11 14:14:44
问题 This morning I run npm install and the node_modules was created with all the files in it. Then a few hour after, I run the same command same package.json file... no error, node_modules was created, but empty!? ANy ideas? Here my package.json, very regular generated via an npm init adding tedious package. { "name": "tedious", "version": "2.1.1", "description": "COnnect to Database", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type"

How do I connect to SQL Azure from NodeJS/Tedious?

◇◆丶佛笑我妖孽 提交于 2019-12-10 22:09:06
问题 I have a SQL Azure database that I'm trying to connect to from a NodeJS application running in an Azure Linux VM. Everything works fine when I'm on a local SQL Database/and local machine for NodeJS. However, when I run from my vm, I get the following output (My trace output plus the Tedious debug event): connected to XXXXXXX.database.windows.net:1433 State change: Connecting -> SentPrelogin State change: SentPrelogin -> SentLogin7WithStandardLogin connection to XXXXXXX.database.windows.net

can't connect to DB - EADDRNOTAVAIL

℡╲_俬逩灬. 提交于 2019-12-10 10:54:13
问题 I have a simple node.js app that can't connect to a SQL Db. Web server is Azure Web App, running node.js and using Tedious for SQL. DB is Azure SQL Database. This is the detailed error: { message: 'Failed to connect to xxx.database.windows.net:1433 - undefined', code: 'ESOCKET' } Thu Jan 14 2016 08:05:05 GMT+0000 (Coordinated Universal Time): Unaught exception: ConnectionError: Connection lost - connect EADDRNOTAVAIL at Connection. (D:\home\site\api\node_modules\tedious\lib\connection.js:797

Failed to connect to local SQL Server database using Tedious and Node JS

▼魔方 西西 提交于 2019-12-09 19:25:56
问题 I am trying to connect to SQL Server on my local machine. I am trying to use tedious and tedious-ntlm. The configuration for both is as below: var tds = require("tedious-ntlm"); //var tds = require("tedious"); var config = { userName: 'pratikdb', password: 'pratikdb', server: '.', options: { database: "TEST", debug: { packet: false, payload: false, token: false, data: false }, encrypt: true } }; http.createServer(app).listen(app.get('port'), function () { console.log('Express server listening

How to set application name in sequelize connection object?

柔情痞子 提交于 2019-12-06 02:44:09
Summary: I want to change the application name of the connection string when initialize a new sequalize object. based on this stackoverflow question , I set the appName of dialectOptions as follows: let conn = new Sequelize(this.models.sequelize.config.database, this.models.sequelize.config.username, this.models.sequelize.config.password, { host: this.models.sequelize.config.host, dialect: this.models.sequelize.getDialect(), dialectOptions: { appName: "userid=-2@gid=" + gid } }); Question: When I execute a transaction like the following code, the application name does not pass to the SQL

Failed to connect to local SQL Server database using Tedious and Node JS

守給你的承諾、 提交于 2019-12-04 13:11:43
I am trying to connect to SQL Server on my local machine. I am trying to use tedious and tedious-ntlm. The configuration for both is as below: var tds = require("tedious-ntlm"); //var tds = require("tedious"); var config = { userName: 'pratikdb', password: 'pratikdb', server: '.', options: { database: "TEST", debug: { packet: false, payload: false, token: false, data: false }, encrypt: true } }; http.createServer(app).listen(app.get('port'), function () { console.log('Express server listening on port ' + app.get('port')); var connection = new tds.Connection(config); connection.on('connect',