host
to my DB host nameConnection {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
config:
ConnectionConfig {
host: '...',
port: 3306,
localAddress: undefined,
socketPath: undefined,
user: '...',
password: '...',
database: '...',
connectTimeout: 10000,
insecureAuth: false,
supportBigNumbers: false,
bigNumberStrings: false,
dateStrings: false,
debug: undefined,
trace: true,
stringifyObjects: false,
timezone: 'local',
flags: '',
queryFormat: undefined,
pool: undefined,
ssl: false,
multipleStatements: false,
typeCast: true,
maxPacketSize: 0,
charsetNumber: 33,
clientFlags: 455631 },
_socket: undefined,
_protocol:
Protocol {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
readable: true,
writable: true,
_config:
ConnectionConfig {
host: '...',
port: 3306,
localAddress: undefined,
socketPath: undefined,
user: '...',
password: '...',
database: '...',
connectTimeout: 10000,
insecureAuth: false,
supportBigNumbers: false,
bigNumberStrings: false,
dateStrings: false,
debug: undefined,
trace: true,
stringifyObjects: false,
timezone: 'local',
flags: '',
queryFormat: undefined,
pool: undefined,
ssl: false,
multipleStatements: false,
typeCast: true,
maxPacketSize: 0,
charsetNumber: 33,
clientFlags: 455631 },
_connection: [Circular],
_callback: null,
_fatalError: null,
_quitSequence: null,
_handshake: false,
_handshaked: false,
_ended: false,
_destroyed: false,
_queue: [],
_handshakeInitializationPacket: null,
_parser:
Parser {
_supportBigNumbers: false,
_buffer: <Buffer >,
_nextBuffers: [Object],
_longPacketBuffers: [Object],
_offset: 0,
_packetEnd: null,
_packetHeader: null,
_packetOffset: null,
_onError: [Function: bound handleParserError],
_onPacket: [Function: bound ],
_nextPacketNumber: 0,
_encoding: 'utf-8',
_paused: false } },
_connectCalled: false,
state: 'disconnected',
threadId: null }
Hi folks,
Does anyone have any experience with using SESSION_CONTEXT
on SqlServer 2016/2017?
I'm running into some issues, and I'm hoping someone can help me confirm it's not just me!
// Assuming some connection pool: cp
const sql = require('mssq');
const request = new sql.Request(cp).query("SELECT SESSION_CONTEXT(N'user_var') AS [sc]");
request
.then(r => console.log(r))
.catch(e => console.log(e));
I'm running into an internal error
, with an unknown
sqlstate
. I'm hoping I'm missing something here. Any ideas?
Cheers!
const sql = require('mssql');
async getCatalogbyId({dbconfig, catId}){
let pool = await sql.connect(dbconfig);
let catalog = await pool.request().query(`SELECT * FROM oper.CATALOG WHERE CATID = ${catId}`);
return catalog.recordset;
}
TCP/IP
settings under IP Addresses
changed TCP Dynamic Ports
to blank and TCP Port
to 1433
, after restarting the service, no longer have time outs. Don't recall if this is the same type of timeouts you both are refering to...but worth looking into..
host: 'localhost\\SQLEXPRESS'
I'm using host: 'localhost'
pg
package.
Hi all, My query looks like
select 1,2,3,4;
in results.recordset, what i was exptecting is for the object result.recordset.toTable()
{
"columns":[
{"name":"","nullable":false},
{"name":"","nullable":false},
{"name":"","nullable":false},
{"name":"","nullable":false}
],"
rows":[
[1,2,3,4]
]
}
instead I am getting
{"columns":[{"name":"","nullable":false}],"rows":[[[1,2,3,4]]]}
How to overcome this? (Results are automatically grouped in to object based on column headers. in my case no column names are preset. )
Hi i am using mssql nodejs package, encrypted data and NTLM login is throwing issue
(node:9988) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead.
my Config File look like this
var config = {
"userName": "user.name",
"password": "password",
"server": "servername",
"domain": "DOMAIN_NAME_CAPITALIZED_AND_NOT_FQDM",
"options": {
"encrypt": false
}
};
bulk
requests and inserting geometry
type data? I have a pretty simple scenario but specifically introduction a geometry column results in this error TypeError: "value" argument is out of bounds
at checkInt (buffer.js:1041:11)
at Buffer.writeUInt16LE (buffer.js:1099:5)
at WritableTrackingBuffer.writeUInt16LE (/var/task/node_modules/tedious/lib/tracking-buffer/writable-tracking-buffer.js:87:19)
at WritableTrackingBuffer.writeUsVarbyte (/var/task/node_modules/tedious/lib/tracking-buffer/writable-tracking-buffer.js:243:12)
at Object.writeParameterData (/var/task/node_modules/tedious/lib/data-type.js:864:25)
at BulkLoad.addRow (/var/task/node_modules/tedious/lib/bulk-load.js:141:17)
at parent.acquire (/var/task/node_modules/mssql/lib/tedious.js:473:16)
at _acquire.then.connection (/var/task/node_modules/mssql/lib/base.js:172:42)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
this[data] = await new Promise((resolve, reject) => {
var request = new sql.Request(this[db]);
var query = queries.getErrors;
//get the records for the block #blockNo
request.on('row', (row) => {
console.log(`Got row!`);
});
request.query(query, (err, result) => {
if (err) {
console.error(`An error occurred while processing the request: \n${err}`);
reject(err);
}
else {
console.info(`Received ${result.recordset.length} records.`);
resolve(result.recordset);
}
});
}) || [];
Problem is that even though I get 500+ records back, the row event never fires. Any suggestions?
(node:18908) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
warning.js:18
at Function.all (<anonymous>)
at c:\Users\rutherfordc\Documents\GitHub\migration-plus\index.js:10:11
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:18908) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
warning.js:18
(node:18908) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
warning.js:18
(node:18908) UnhandledPromiseRejectionWarning: ReferenceError: results is not defined
warning.js:18
at c:\Users\rutherfordc\Documents\GitHub\migration-plus\index.js:15:11
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:18908) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
dhensby on master
Update changelog for v5 Merge pull request #796 from dh… (compare)