Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wankdanker/node-unixodbc-isql-json
A hacky solution for querying ODBC data sources (including MS SQL) with nodejs.
https://github.com/wankdanker/node-unixodbc-isql-json
Last synced: 14 days ago
JSON representation
A hacky solution for querying ODBC data sources (including MS SQL) with nodejs.
- Host: GitHub
- URL: https://github.com/wankdanker/node-unixodbc-isql-json
- Owner: wankdanker
- Created: 2011-02-17T23:03:01.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-05-13T20:42:32.000Z (over 13 years ago)
- Last Synced: 2024-11-06T01:17:23.495Z (2 months ago)
- Language: C
- Homepage:
- Size: 258 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Please note. I will not be developing this any more. For useful ODBC in nodejs check out [node-odbc](https://github.com/wankdanker/node-odbc)
node-unixodbc-isql-json
=======================A hacky solution for querying ODBC data sources (including MS SQL) with nodejs.
Rather than develop a C++ module for nodejs that would bind to the unixODBC libraries, I have hacked
the original isql tool to accept SQL queries via stdin and then output the resulting recordset via stdout using
JSON encoding. I call this tool isql-json.Using the nodejs child_process class, we can spawn a process of isql-json and pass queries to it via the
child_process's stdin stream and receive responses via the child_process's stdout stream.This is by no means a finished product. There is still a ton of error handling and optimizations that need
to be addressed.Use at your own risk.
Install
-------On an Ubuntu machine you need to make sure you have odbc installed:
apt-get install unixodbc unixodbc-dev
If you are going to be querying a MS SQL server, be sure to install the tds packages:
apt-get install freetds-bin freetds-common tdsodbc
Get the source for node-unixodbc-isql-json from github:
git clone git://github.com/wankdanker/node-unixodbc-isql-json.git
In the isql-json directory, do the standard configure and make
cd isql-json
./configure
makeModify sql.js to include the proper DSN, userName and password for your data source
Try it out:
node sql.js
select top 10 * from tableName