{"id":29150392,"url":"https://github.com/ratanakvlun/node-odbc","last_synced_at":"2026-02-27T21:34:44.905Z","repository":{"id":143781148,"uuid":"113625191","full_name":"ratanakvlun/node-odbc","owner":"ratanakvlun","description":"ODBC bindings for Node.js","archived":false,"fork":false,"pushed_at":"2017-12-25T20:58:45.000Z","size":523,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-23T13:03:42.999Z","etag":null,"topics":["database","nodejs","odbc","sql"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ratanakvlun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-08T23:07:55.000Z","updated_at":"2025-05-19T13:48:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"64ed1133-2ab4-4fa6-88d8-02b311684c59","html_url":"https://github.com/ratanakvlun/node-odbc","commit_stats":null,"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/ratanakvlun/node-odbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratanakvlun%2Fnode-odbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratanakvlun%2Fnode-odbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratanakvlun%2Fnode-odbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratanakvlun%2Fnode-odbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratanakvlun","download_url":"https://codeload.github.com/ratanakvlun/node-odbc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratanakvlun%2Fnode-odbc/sbom","scorecard":{"id":762553,"data":{"date":"2025-08-11","repo":{"name":"github.com/ratanakvlun/node-odbc","commit":"43ba94ab7e8a1559fdfc24e1331da101e3994306"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.0.5 not signed: https://api.github.com/repos/ratanakvlun/node-odbc/releases/9027341","Warn: release artifact v2.0.4 not signed: https://api.github.com/repos/ratanakvlun/node-odbc/releases/8846185","Warn: release artifact v2.0.3 not signed: https://api.github.com/repos/ratanakvlun/node-odbc/releases/8842914","Warn: release artifact v2.0.5 does not have provenance: https://api.github.com/repos/ratanakvlun/node-odbc/releases/9027341","Warn: release artifact v2.0.4 does not have provenance: https://api.github.com/repos/ratanakvlun/node-odbc/releases/8846185","Warn: release artifact v2.0.3 does not have provenance: https://api.github.com/repos/ratanakvlun/node-odbc/releases/8842914"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}}]},"last_synced_at":"2025-08-22T23:49:28.248Z","repository_id":143781148,"created_at":"2025-08-22T23:49:28.248Z","updated_at":"2025-08-22T23:49:28.248Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29915345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","nodejs","odbc","sql"],"created_at":"2025-06-30T23:10:28.864Z","updated_at":"2026-02-27T21:34:44.891Z","avatar_url":"https://github.com/ratanakvlun.png","language":"C++","readme":"@ratanakvlun/node-odbc\n----------------------\n\nThis module is based off of [`node-odbc`](https://github.com/wankdanker/node-odbc). It\nis an enhanced version that mainly targets a Windows and SQL Server configuration.\n\nUses [Semantic Versioning](https://semver.org).\n\nnode-odbc\n---------\n\nAn asynchronous/synchronous interface for node.js to unixODBC and its supported\ndrivers.\n\nrequirements\n------------\n\n* unixODBC binaries and development libraries for module compilation\n  * on Ubuntu/Debian `sudo apt-get install unixodbc unixodbc-dev`\n  * on RedHat/CentOS `sudo yum install unixODBC unixODBC-devel`\n  * on OSX using macports.org `sudo port unixODBC`\n* odbc drivers for target database\n* properly configured odbc.ini and odbcinst.ini.\n\ninstall\n-------\n\nAfter insuring that all requirements are installed you may install by one of the\ntwo following options:\n\n### git\n\n```bash\ngit clone git://github.com/wankdanker/node-odbc.git\ncd node-odbc\nnode-gyp configure build\n```\n### npm\n\n```bash\nnpm install odbc\n```\n\nquick example\n-------------\n\n```javascript\nvar db = require('odbc')()\n  , cn = process.env.ODBC_CONNECTION_STRING\n  ;\n\ndb.open(cn, function (err) {\n  if (err) return console.log(err);\n  \n  db.query('select * from user where user_id = ?', [42], function (err, data) {\n    if (err) console.log(err);\n    \n    console.log(data);\n\n    db.close(function () {\n      console.log('done');\n    });\n  });\n});\n```\n\napi\n---\n\n### Database\n\nThe simple api is based on instances of the `Database` class. You may get an \ninstance in one of the following ways:\n\n```javascript\nrequire(\"odbc\").open(connectionString, function (err, db){\n  //db is already open now if err is falsy\n});\n```\n\nor by using the helper function:\n\n```javascript\nvar db = require(\"odbc\")();\n``` \n\nor by creating an instance with the constructor function:\n\n```javascript\nvar Database = require(\"odbc\").Database\n  , db = new Database();\n```\n\n#### .open(connectionString, callback)\n\nOpen a connection to a database.\n\n* **connectionString** - The ODBC connection string for your database\n* **callback** - `callback (err)`\n\n```javascript\nvar db = require(\"odbc\")()\n\t, cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n\t;\n\ndb.open(cn, function (err) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\n\t//we now have an open connection to the database\n});\n```\n#### .openSync(connectionString)\n\nSynchronously open a connection to a database.\n\n* **connectionString** - The ODBC connection string for your database\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\ntry {\n  var result = db.openSync(cn);\n}\ncatch (e) {\n  console.log(e.message);\n}\n\n//we now have an open connection to the database\n```\n\n#### .query(sqlQuery [, bindingParameters], callback)\n\nIssue an asynchronous SQL query to the database which is currently open.\n\n* **sqlQuery** - The SQL query to be executed.\n* **bindingParameters** - _OPTIONAL_ - An array of values that will be bound to\n    any '?' characters in `sqlQuery`.\n* **callback** - `callback (err, rows, moreResultSets)`\n\n```javascript\nvar db = require(\"odbc\")()\n\t, cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n\t;\n\ndb.open(cn, function (err) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\n\t//we now have an open connection to the database\n\t//so lets get some data\n\tdb.query(\"select top 10 * from customers\", function (err, rows, moreResultSets) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t}\n\t\t\n\t\tconsole.log(rows);\n\n\t\t//if moreResultSets is truthy, then this callback function will be called\n\t\t//again with the next set of rows.\n\t});\n});\n```\n\n#### .querySync(sqlQuery [, bindingParameters])\n\nSynchronously issue a SQL query to the database that is currently open.\n\n* **sqlQuery** - The SQL query to be executed.\n* **bindingParameters** - _OPTIONAL_ - An array of values that will be bound to\n    any '?' characters in `sqlQuery`.\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//blocks until the connection is opened.\ndb.openSync(cn);\n\n//blocks until the query is completed and all data has been acquired\nvar rows = db.querySync(\"select top 10 * from customers\");\n\nconsole.log(rows);\n```\n\n#### .close(callback)\n\nClose the currently opened database.\n\n* **callback** - `callback (err)`\n\n```javascript\nvar db = require(\"odbc\")()\n\t, cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n\t;\n\ndb.open(cn, function (err) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\t\n\t//we now have an open connection to the database\n\t\n\tdb.close(function (err) {\n\t\tconsole.log(\"the database connection is now closed\");\n\t});\n});\n```\n\n#### .closeSync()\n\nSynchronously close the currently opened database.\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\n//Blocks until the connection is closed\ndb.closeSync();\n```\n\n#### .prepare(sql, callback)\n\nPrepare a statement for execution.\n\n* **sql** - SQL string to prepare\n* **callback** - `callback (err, stmt)`\n\nReturns a `Statement` object via the callback\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\ndb.prepare(\"insert into hits (col1, col2) VALUES (?, ?)\", function (err, stmt) {\n  if (err) {\n    //could not prepare for some reason\n    console.log(err);\n    return db.closeSync();\n  }\n\n  //Bind and Execute the statment asynchronously\n  stmt.execute(['something', 42], function (err, result) {\n    result.closeSync();\n\n    //Close the connection\n    db.closeSync();\n  });\n})\n```\n\n#### .prepareSync(sql)\n\nSynchronously prepare a statement for execution.\n\n* **sql** - SQL string to prepare\n\nReturns a `Statement` object\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\n//Blocks while preparing the statement\nvar stmt = db.prepareSync(\"insert into hits (col1, col2) VALUES (?, ?)\")\n\n//Bind and Execute the statment asynchronously\nstmt.execute(['something', 42], function (err, result) {\n  result.closeSync();\n\n  //Close the connection\n  db.closeSync();\n});\n```\n\n#### .beginTransaction(callback)\n\nBegin a transaction\n\n* **callback** - `callback (err)`\n\n#### .beginTransactionSync()\n\nSynchronously begin a transaction\n\n#### .commitTransaction(callback)\n\nCommit a transaction\n\n* **callback** - `callback (err)`\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\ndb.beginTransaction(function (err) {\n  if (err) {\n    //could not begin a transaction for some reason.\n    console.log(err);\n    return db.closeSync();\n  }\n\n  var result = db.querySync(\"insert into customer (customerCode) values ('stevedave')\");\n\n  db.commitTransaction(function (err) {\n    if (err) {\n      //error during commit\n      console.log(err);\n      return db.closeSync();\n    }\n\n    console.log(db.querySync(\"select * from customer where customerCode = 'stevedave'\"));\n\n    //Close the connection\n    db.closeSync();\n  });\n})\n```\n\n#### .commitTransactionSync()\n\nSynchronously commit a transaction\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\ndb.beginTransactionSync();\n\nvar result = db.querySync(\"insert into customer (customerCode) values ('stevedave')\");\n\ndb.commitTransactionSync();\n\nconsole.log(db.querySync(\"select * from customer where customerCode = 'stevedave'\"));\n\n//Close the connection\ndb.closeSync();\n```\n\n#### .rollbackTransaction(callback)\n\nRollback a transaction\n\n* **callback** - `callback (err)`\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\ndb.beginTransaction(function (err) {\n  if (err) {\n    //could not begin a transaction for some reason.\n    console.log(err);\n    return db.closeSync();\n  }\n\n  var result = db.querySync(\"insert into customer (customerCode) values ('stevedave')\");\n\n  db.rollbackTransaction(function (err) {\n    if (err) {\n      //error during rollback\n      console.log(err);\n      return db.closeSync();\n    }\n\n    console.log(db.querySync(\"select * from customer where customerCode = 'stevedave'\"));\n\n    //Close the connection\n    db.closeSync();\n  });\n})\n```\n\n#### .rollbackTransactionSync()\n\nSynchronously rollback a transaction\n\n```javascript\nvar db = require(\"odbc\")()\n  , cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n  ;\n\n//Blocks until the connection is open\ndb.openSync(cn);\n\ndb.beginTransactionSync();\n\nvar result = db.querySync(\"insert into customer (customerCode) values ('stevedave')\");\n\ndb.rollbackTransactionSync();\n\nconsole.log(db.querySync(\"select * from customer where customerCode = 'stevedave'\"));\n\n//Close the connection\ndb.closeSync();\n```\n\n----------\n\n### Pool\n\nThe node-odbc `Pool` is a rudimentary connection pool which will attempt to have\ndatabase connections ready and waiting for you when you call the `open` method.\n\nIf you use a `Pool` instance, any connection that you close will cause another\nconnection to be opened for that same connection string. That connection will\nbe used the next time you call `Pool.open()` for the same connection string.\n\nThis should probably be changed.\n\n#### .open(connectionString, callback)\n\nGet a Database` instance which is already connected to `connectionString`\n\n* **connectionString** - The ODBC connection string for your database\n* **callback** - `callback (err, db)`\n\n```javascript\nvar Pool = require(\"odbc\").Pool\n\t, pool = new Pool()\n\t, cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n\t;\n\npool.open(cn, function (err, db) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\n\t//db is now an open database connection and can be used like normal\n\t//if we run some queries with db.query(...) and then call db.close();\n\t//a connection to `cn` will be re-opened silently behind the scense\n\t//and will be ready the next time we do `pool.open(cn)`\n});\n```\n\n#### .close(callback)\n\nClose all connections in the `Pool` instance\n\n* **callback** - `callback (err)`\n\n```javascript\nvar Pool = require(\"odbc\").Pool\n\t, pool = new Pool()\n\t, cn = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\"\n\t;\n\npool.open(cn, function (err, db) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\n\t//db is now an open database connection and can be used like normal\n\t//but all we will do now is close the whole pool\n\t\n\tpool.close(function () {\n\t\tconsole.log(\"all connections in the pool are closed\");\n\t});\n});\n```\n\nexample\n-------\n\n```javascript\nvar odbc = require(\"odbc\")\n\t, util = require('util')\n\t, db = new odbc.Database()\n\t;\n\nvar connectionString = \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname\";\n\ndb.open(connectionString, function(err) {\n\tdb.query(\"select * from table\", function(err, rows, moreResultSets) {\n\t\tconsole.log(util.inspect(rows, null, 10));\n\t\t\n\t\tdb.close(function() {\n\t\t\tconsole.log(\"Database connection closed\");\n\t\t});\n\t});\n});\n```\n\ntesting\n-------\n\nTests can be run by executing `npm test` from within the root of the node-odbc\ndirectory. You can also run the tests by executing `node run-tests.js` from\nwithin the `/test` directory.\n\nBy default, the tests are setup to run against a sqlite3 database which is\ncreated at test time. This will require proper installation of the sqlite odbc\ndriver. On Ubuntu: `sudo apt-get install libsqliteodbc`\n\nbuild options\n-------------\n\n### Debug\n\nIf you would like to enable debugging messages to be displayed you can add the \nflag `DEBUG` to the defines section of the `binding.gyp` file and then execute \n`node-gyp rebuild`.\n\n```javascript\n\u003csnip\u003e\n'defines' : [\n  \"DEBUG\"\n],\n\u003csnip\u003e\n```\n\n### Dynodbc\n\nYou may also enable the ability to load a specific ODBC driver and bypass the \nODBC driver management layer. A performance increase of ~5Kqps was seen using\nthis method with the libsqlite3odbc driver. To do this, specify the `dynodbc`\nflag in the defines section of the `binding.gyp` file. You will also need to \nremove any library references in `binding.gyp`. Then execute `node-gyp\nrebuild`.\n\n```javascript\n\u003csnip\u003e\n'defines' : [\n  \"dynodbc\"\n],\n'conditions' : [\n  [ 'OS == \"linux\"', {\n    'libraries' : [ \n      //remove this: '-lodbc' \n    ],\n\u003csnip\u003e\n```\n\n### Unicode\n\nBy default, UNICODE suppport is enabled. This should provide the most accurate\nway to get Unicode strings submitted to your database. For best results, you \nmay want to put your Unicode string into bound parameters. \n\nHowever, if you experience issues or you think that submitting UTF8 strings will\nwork better or faster, you can remove the `UNICODE` define in `binding.gyp`\n\n```javascript\n\u003csnip\u003e\n'defines' : [\n  \"UNICODE\"\n],\n\u003csnip\u003e\n```\n\n### timegm vs timelocal\n\nWhen converting a database time to a C time one may use `timegm` or `timelocal`. See\n`man timegm` for the details of these two functions. By default the node-odbc bindings\nuse `timelocal`. If you would prefer for it to use `timegm` then specify the `TIMEGM`\ndefine in `binding.gyp`\n\n```javascript\n\u003csnip\u003e\n'defines' : [\n  \"TIMEGM\"\n],\n\u003csnip\u003e\n```\n\n### Strict Column Naming\n\nWhen column names are retrieved from ODBC, you can request by SQL_DESC_NAME or\nSQL_DESC_LABEL. SQL_DESC_NAME is the exact column name or none if there is none\ndefined. SQL_DESC_LABEL is the heading or column name or calculation. \nSQL_DESC_LABEL is used by default and seems to work well in most cases.\n\nIf you want to use the exact column name via SQL_DESC_NAME, enable the `STRICT_COLUMN_NAMES`\ndefine in `binding.gyp`\n\n```javascript\n\u003csnip\u003e\n'defines' : [\n  \"STRICT_COLUMN_NAMES\"\n],\n\u003csnip\u003e\n```\n\ntips\n----\n### Using node \u003c v0.10 on Linux\n\nBe aware that through node v0.9 the uv_queue_work function, which is used to \nexecute the ODBC functions on a separate thread, uses libeio for its thread \npool. This thread pool by default is limited to 4 threads.\n\nThis means that if you have long running queries spread across multiple \ninstances of odbc.Database() or using odbc.Pool(), you will only be able to \nhave 4 concurrent queries.\n\nYou can increase the thread pool size by using @developmentseed's [node-eio]\n(https://github.com/developmentseed/node-eio).\n\n#### install: \n```bash\nnpm install eio\n```\n\n#### usage:\n```javascript\nvar eio = require('eio'); \neio.setMinParallel(threadCount);\n```\n\n### Using the FreeTDS ODBC driver\n\n* If you have column names longer than 30 characters, you should add \n  \"TDS_Version=7.0\" to your connection string to retrive the full column name.\n  * Example : \"DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname;TDS_Version=7.0\"\n* If you got error \"[unixODBC][FreeTDS][SQL Server]Unable to connect to data source\" \n  Try use SERVERNAME instead of SERVER\n  * Example : \"DRIVER={FreeTDS};SERVERNAME=host;UID=user;PWD=password;DATABASE=dbname\"\n* Be sure that your odbcinst.ini has the proper threading configuration for your\n  FreeTDS driver. If you choose the incorrect threading model it may cause\n  the thread pool to be blocked by long running queries. This is what \n  @wankdanker currently uses on Ubuntu 12.04:\n\n```\n[FreeTDS]\nDescription     = TDS driver (Sybase/MS SQL)\nDriver          = libtdsodbc.so\nSetup           = libtdsS.so\nCPTimeout       = 120\nCPReuse         = \nThreading       = 0\n```\n\ncontributors\n------\n* Dan VerWeire (dverweire@gmail.com)\n* Lee Smith (notwink@gmail.com)\n* Bruno Bigras\n* Christian Ensel\n* Yorick\n* Joachim Kainz\n* Oleg Efimov\n* paulhendrix\n\nlicense\n-------\n\nCopyright (c) 2013 Dan VerWeire \u003cdverweire@gmail.com\u003e\n\nCopyright (c) 2010 Lee Smith \u003cnotwink@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR \nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER \nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratanakvlun%2Fnode-odbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratanakvlun%2Fnode-odbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratanakvlun%2Fnode-odbc/lists"}