How to use the tedious.TYPES.VarChar function in tedious

To help you get started, we’ve selected a few tedious examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tediousjs / tedious / examples / storedProcedureWithParameters.js View on Github external
connection.on('connect', function(err) {
  var request = new Request('countChar',
    function(err) {
      if (err) {
        console.log(err);
      }

      connection.close();
    });

  request.addParameter('inputVal', TYPES.VarChar, 'hello world');
  request.addOutputParameter('outputCount', TYPES.Int);

  request.on('returnValue', function(paramName, value, metadata) {
    console.log(paramName + ' : ' + value);
  });

  connection.callProcedure(request);
});
github tinkerscript / sqlssb / source / dataAdapter.js View on Github external
return new Promise((resolve, reject) => {
      const request = new Request(query, err => {
        if (err) {
          reject(err)
        } else {
          resolve()
        }
        connection.close()
      })

      request.addParameter('body', TYPES.VarChar, body)
      request.addParameter('target', TYPES.VarChar, target)
      connection.execSql(request)
    })
  }
github hackforla / tdm-calculator / app / services / faq.service.js View on Github external
.executeProc("Faq_Update", sqlRequest => {
      sqlRequest.addParameter("faqId", TYPES.Int, faq.faqId);
      sqlRequest.addParameter("question", TYPES.VarChar, faq.question, {
        length: 250
      });
      sqlRequest.addParameter("answer", TYPES.VarChar, faq.answer, {
        length: 500
      });
    })
    .then(response => {
github hackforla / tdm-calculator / app / services / rule.service.js View on Github external
return mssql.executeProc("CalculationRule_Update", sqlRequest => {
    sqlRequest.addParameter("code", TYPES.NVarChar, item.code, {
      length: 50
    });
    sqlRequest.addParameter("name", TYPES.NVarChar, item.name, {
      length: 100
    });
    sqlRequest.addParameter("category", TYPES.VarChar, item.category, {
      length: 20
    });
    sqlRequest.addParameter("dataType", TYPES.VarChar, item.dataType, {
      length: 20
    });
    sqlRequest.addParameter("units", TYPES.VarChar, item.units, {
      length: 50
    });
    sqlRequest.addParameter(
      "value",
      TYPES.VarChar,
      JSON.stringify(item.value),
      {
        length: 200
      }
    );
github tinkerscript / sqlssb / source / dataAdapter.js View on Github external
return new Promise((resolve, reject) => {
      const request = new Request(query, err => {
        if (err) {
          reject(err)
        } else {
          resolve()
        }
        connection.close()
      })

      request.addParameter('body', TYPES.VarChar, body)
      request.addParameter('target', TYPES.VarChar, target)
      connection.execSql(request)
    })
  }
github hackforla / tdm-calculator / app / services / rule.service.js View on Github external
.executeProc("CalculationRule_Insert", sqlRequest => {
      sqlRequest.addParameter("calculationId", TYPES.Int, item.calculationId);
      sqlRequest.addParameter("code", TYPES.NVarChar, item.code, {
        length: 50
      });
      sqlRequest.addParameter("name", TYPES.NVarChar, item.name, {
        length: 100
      });
      sqlRequest.addParameter("category", TYPES.VarChar, item.category, {
        length: 20
      });
      sqlRequest.addParameter("dataType", TYPES.VarChar, item.dataType, {
        length: 20
      });
      sqlRequest.addParameter("units", TYPES.VarChar, item.units, {
        length: 50
      });
      sqlRequest.addParameter(
        "value",
        TYPES.VarChar,
        JSON.stringify(item.value),
        {
          length: 200
        }
      );
      sqlRequest.addParameter(
        "functionBody",
        TYPES.NVarChar,
github hackforla / tdm-calculator / app / services / faq.service.js View on Github external
.executeProc("Faq_Update", sqlRequest => {
      sqlRequest.addParameter("faqId", TYPES.Int, faq.faqId);
      sqlRequest.addParameter("question", TYPES.VarChar, faq.question, {
        length: 250
      });
      sqlRequest.addParameter("answer", TYPES.VarChar, faq.answer, {
        length: 500
      });
    })
    .then(response => {
github kkrisz1 / staruml-reverse-db / mssql / MsSqlDbClient.js View on Github external
getTediousType(type) {
    switch (type) {
      case 'varchar':
        return TYPES.VarChar;
    }
  }
}