by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 2019 22:53
    MichaelSun90 synchronize #855
  • Jan 31 2019 21:15
    arthurschreiber commented #856
  • Jan 31 2019 18:21
    Hadis-Fard closed #853
  • Jan 31 2019 18:15
    BrianLawton opened #856
  • Jan 31 2019 01:36
    MichaelSun90 opened #855
  • Jan 30 2019 23:16

    arthurschreiber on rework-connection-close

    feat: add new `.destroy()` meth… refactor: Add `.destroy()` meth… fix: handle cancelled request e… and 5 more (compare)

  • Jan 30 2019 20:41
  • Jan 30 2019 20:16
    jennypho edited #854
  • Jan 30 2019 19:23
    jennypho closed #852
  • Jan 30 2019 19:23
    jennypho commented #852
  • Jan 30 2019 19:22
    jennypho commented #852
  • Jan 30 2019 18:25
  • Jan 29 2019 22:48
    arthurschreiber commented #830
  • Jan 29 2019 22:48
    arthurschreiber commented #830
  • Jan 29 2019 22:36
    MichaelSun90 commented #830
  • Jan 29 2019 08:58
    Alextunchii commented #853
  • Jan 29 2019 08:15
    Alextunchii edited #853
  • Jan 29 2019 08:15
    Alextunchii edited #853
  • Jan 29 2019 08:14
    Alextunchii edited #853
  • Jan 29 2019 00:43
    chdh commented #853
appnerd
@appnerd

ReferenceError: Can't find variable: Buffer

phantomjs://platform/writable-tracking-buffer.js:18
SyntaxError: Invalid character: '`'

phantomjs://platform/connection.js:690 in loadModule
phantomjs://platform/bootstrap.js:282 in .js
phantomjs://platform/bootstrap.js:278 in _load
phantomjs://platform/bootstrap.js:311 in require
phantomjs://platform/bootstrap.js:263 in require
phantomjs://platform/tedious.js:5
TypeError: undefined is not a constructor (evaluating 'util.inherits(ConnectionError, Error)')

phantomjs://platform/errors.js:24
TypeError: Object is not a constructor (evaluating 'new Connection(config)')

phantomjs://code/test.js:12 in global code

thats the error I am getting on latest build
Javier Castro
@jacargentina
hi! any chance for having a release of tedious from current master ?
Ben Randall
@veleek
I'm interested in cleaning up a few things in the tedious documentation, but I can't actually find where the documentation is located.
Anybody know?
Luis Bosquez
@LuisBosquez
@veleek Yes! Documentation is a different branch called gh-pages. What changes have you been contemplating?
Arthur Schreiber
@arthurschreiber
@appnerd Tedious can not be used from your Browser directly, it's meant to be used from Node.js
@veleek As pointed out by @LuisBosquez, the documentation is located in a different branch
Ben Randall
@veleek
@LuisBosquez Ahhhh, another branch. I KNEW there was a gh-pages something somewhere but I couldn't find it. There's an issue open around the 'done' and 'doneProc' events that I wanted to fix because I ran into it myself.
Ben Randall
@veleek
Just submitted a PR for the changes.
danbopes
@danbopes
Hey guys. I've currently developed a branch of tedious to work with the old SQL Server 7. I was wondering if there was any interest in supporting it, if I submit a pull request.
danbopes
@danbopes
There's some issues with some of the tests, due to the fact that the schema tables are named differently, but I'm willing to put in some work to try and provide as much test coverage as I can.
Rajamohan Manivannan
@zybernau
Hey Guys... Is it possible to do HTTP proxy tunnel while connecting?
Stephen Pugliese
@SteveyPugs
Hi
Pablo Ariel Bilevich Alaniz
@pablobvch
Hey everyone. I would like to use tedious as a promises. I know it exists the tedious-promises. Does anyone know if I can exec stored procedures?
Arthur Schreiber
@arthurschreiber
@danbopes That'd be great! Pull requests are always welcome
@zybernau I'm not sure what you mean by HTTP proxy tunnel?
@pablobvch Tedious does not have support for promises built-in - you'll have to use another npm module like tedious-promises for now
Also, executing stored procedures works just fine
:)
Pablo Ariel Bilevich Alaniz
@pablobvch
Hey @arthurschreiber thank for your help. I have a problem with tedious but I couldnt resolve it. I put my post in at the end of tediousjs/tedious#458. Requests can only be made in the LoggedIn state, not the SentClientRequest state.
I could execute stored procedure but in this case, i need to execute in a nested way with promises.
With tediuos-promises i dont know how to execute sps
Pablo Ariel Bilevich Alaniz
@pablobvch
Hey people, I coud resolve my problem. I used ('tedious-promises') and
('tedious-connection-pool'), bur now, i have another problem. I have a memory leak using them. I share you the code of my API
const tp = require('tedious-promises');
const {poolConfig,dbConfig} = require('../config.js');
const TYPES = require('tedious').TYPES;
const ConnectionPool = require('tedious-connection-pool');
const CONSTANTS = require('./constants')
const memwatch = require('memwatch-next')

function createAsPromiseWithTransaction(callback, data){

  const pool = new ConnectionPool(poolConfig, dbConfig);

  tp.setConnectionPool(pool); // global scope

  let trans;

  // create the transaction from the a tp instance
  tp.beginTransaction()
    .then(function(newTransaction) {
      // remember the transaction, you'll need it later
      trans = newTransaction;
      return trans.sql(CONSTANTS.SPNames.Area)
        .parameter('IUser', TYPES.UniqueIdentifier, data.iUser)
        .parameter('ParentArea', TYPES.Int, data.parentArea)
        .parameter('Name', TYPES.VarChar, data.nameArea)
        .parameter('ShortName', TYPES.VarChar, data.shortNameArea)
        .parameter('Description', TYPES.VarChar, data.descriptionArea)
        .parameter('Gender', TYPES.Bit, data.gender)
        .parameter('Colour', TYPES.VarChar, data.colour)
        .parameter('X', TYPES.Int, data.x)
        .parameter('Y', TYPES.Int, data.y)
        .parameter('Active', TYPES.Int, data.active)
        .callProcedure();
    })
    .then(function(results) {
      const areaId = results[0].Id
      trans._parameters = {}//tengo que limpiar los parametros de la transaccion para ejecutar el siguiente SP
      return trans.sql(CONSTANTS.SPNames.Symptom)
       .parameter('IUser', TYPES.UniqueIdentifier, data.iUser)
      .parameter('AreaID', TYPES.BigInt, areaId)
      .parameter('Code', TYPES.VarChar, data.code)
      .parameter('Name', TYPES.VarChar, data.nameSymptom)
      .parameter('ShortName', TYPES.VarChar, data.shortNameSymptom)
      .parameter('Description', TYPES.VarChar, data.descriptionSymptom)
      .parameter('Gender', TYPES.Bit, data.gender)
      .parameter('Active', TYPES.Bit, data.active)
      .callProcedure();
    })
    .then(function(results){
      trans._parameters = {}//tengo que limpiar los parametros de la transaccion para ejecutar el siguiente SP
      return trans.sql(CONSTANTS.SPNames.Modifier)
      .parameter('IUser', TYPES.UniqueIdentifier, data.iUser)
      .parameter('Name', TYPES.VarChar, data.nameModifier)
      .parameter('Order', TYPES.SmallInt, data.order)
      .parameter('Active', TYPES.Bit, data.active)
      .callProcedure();
    })
    .then(function(results){
      trans.commitTransaction(callback(null))
      pool.drain()
      return
    })
    .fail(function(err) {
      // rollback on failures
      trans.rollbackTransaction(callback(err))
      pool.drain()
      return
    })

    //
}

module.exports = {
    createAsPromiseWithTransaction
  }
Why am I wrong?
Pablo Ariel Bilevich Alaniz
@pablobvch
it seems so simple. I dont undertande the error cause.
Junsu Mun
@junsumun
Hello I am a newbie to nodejs
Can anyone help me on connecting to mssql server on nodejs?
Suraiya Hameed
@v-suhame
@junsumun You can start with the example here https://github.com/tediousjs/tedious/tree/master/examples
anderklander
@anderklander
Hi, i encountered a new issue when trying to access a newer database than i have used before, but i dont really understand why … TypeError: Cannot read property 'rowCount' of undefined
at Parser.<anonymous> (…\tedious\lib\connection.js:783:20)
this.tokenStreamParser.on('doneInProc', function (token) { if (_this3.request) { _this3.request.emit('doneInProc', token.rowCount, token.more, _this3.request.rst); if (token.rowCount !== undefined) { _this3.request.rowCount += token.rowCount; <----- ERROR }
anderklander
@anderklander
Using mssql 2016, trying to get hold of the exact versions.
Suraiya Hameed
@v-suhame
Can you share your repro code?
anderklander
@anderklander

```function executeStatement() {
var request = new Request("SELECT * FROM ...", function (err, rowCount) {
if (err) {
console.log(err);
}
});

request.on('row', function(columns) {
    var data = {};
    columns.forEach(function(column) {

        data[column.metadata.colName] = column.value;
    });
});

request.on('done', function (rowCount, more, rows) {
    connection.close();
});

request.on('doneInProc', function (rowCount, more, rows) {
    connection.close();
});

connection.execSql(request);

};```

Suraiya Hameed
@v-suhame
@anderklander the issue occurs because the connection is closed before the request gets complete. Removing the connection.close()from done and doneInProc listener and moving it into request callback should fix it.
anderklander
@anderklander
Ah! great! Thanks! Then perhaps strange that it was working with the old setup. Will try as soon as possible.
Junsu Mun
@junsumun
Thank you @v-suhame for the resource. I am still trying to understand concepts and since this is my first time working with database, it is not going well. If you do not mind could you explain to me difference between mssql module and tedious module please? My purpose of all these studies is to create Web API and I am not even sure whether I am studying correct thing now.
Junsu Mun
@junsumun
And how do I connect to MS sql server with windows authentication?
Suraiya Hameed
@v-suhame
node-mssql is a wrapper around tedious package. It offers connection pooling, promises and async/await APIs(which tedious doesn't offer), it is not actively maintained, so I would recommend using tedious if you are not dependent on those features.
Suraiya Hameed
@v-suhame
tedious doesn't support windows authentication currently. We have the implementation for windows authentication ready, but it depends on native package which we don't want to force on every user, the plan is to make it pluggable, you can read more about it here tediousjs/tedious#624
Suraiya Hameed
@v-suhame
If it is a Web API you are creating, you might need a connection pool eventually, apart from node-mssql there is https://github.com/sequelize/sequelize package that uses tedious, you can have a look at that too.
Junsu Mun
@junsumun
Thank you so much for kindly explaining all these to me :+1:
Arthur Schreiber
@arthurschreiber
@/all Hey there! We're thinking about moving from Gitter to Slack, as that's where most contributors are hanging out these days. How do you feel about this? Should we keep the Gitter channel around or archive it?
github-rajk
@github-rajk
how can i establish db connection when i use webdriverio