<commit_before>C++ NodeJS module to work with Firebird SQL Server. Uses libfbclient.
Inspired by ibpp, firebird samples, node-mysql-libmysql, node-postgress and other node modules used as sample source. 

# Features

* Synchronous and Asynchronous methods for connection, query and fetch data;
* Support of Firebird Events (post_event statement);
* Covered with tests in nodeunit;
* blob field support;
* blob stream compatible to node stream class;
* prepared statements;

As for now in plans are:

* connection pool support;
* prepared statements pool;
* transaction parameters support;
* continous refactoring;
* more tests;
* services api.

# Getting Started

You will need:
 NodeJS (tested with v0.6.0)
 Firebird (tested with v2.5)

 All things below were tested on CentOS 5.5.
 
Get Firebird:
 
    wget http://downloads.sourceforge.net/project/firebird/firebird-linux-i386/2.5-Release/FirebirdCS-2.5.0.26074-0.i686.rpm 
    rpm -ivh FirebirdCS-2.5.0.26074-0.i686.rpm 

Update your path: 
    export PATH=$PATH:/opt/firebird/bin

Create some Database: 

    isql -user sysdba -password masterkey
    CREATE DATABASE 'test.fdb';
    CONNECT 'test.fdb';
    CREATE TABLE TEST (id integer, name varchar(50));
    exit;

Clone repository and build module

    git clone git://github.com/xdenser/node-firebird-libfbclient.git
    node-waf configure build
    node-waf configure install
    
or use npm:
    
    npm install firebird

To run tests update ./tests/config.js with your test database connection parameters and

    git submodule update --init
    node-waf test
 
Play with it from node:

    var fb  = require("./firebird");
    sys = require("sys"); 
    var con = fb.createConnection();
    con.connectSync('test.fdb','sysdba','masterkey','');
    con.querySync("insert into test (id,name) values (5, 'new one')");
    var res = con.querySync("select * from test");
    con.commitSync();
    var rows = res.fetchSync("all",true);
    console.log(sys.inspect(rows));

Check also samples directory.    

# Links

- [node.js and firebird installing on Amazon EC2 instance](http://mapopa.blogspot.com/2011/01/nodejs-and-firebird-installing-on.html) on Mariuz's Blog
- [Catch Firebird events with Node.js](http://www.king-foo.be/2011/07/catch-firebird-events-with-node-js) on www.king-foo.be 
- [NodeJS home](http://nodejs.org)
- [Collection of NodeJS modules](https://github.com/joyent/node/wiki/modules)
 
# Reference

 createConnection() method will create Firebird Connection object for you
 
## Connection object

Handles database connection and queries. Supports Synchronous and Asynchronous operation.

### Connection object members
* * *
    function connectSync(database, username, password, role);
<commit_msg>Updated Readme.md with link to first experimental windows binary.<commit_after>C++ NodeJS module to work with Firebird SQL Server. Uses libfbclient.
Inspired by ibpp, firebird samples, node-mysql-libmysql, node-postgress and other node modules used as sample source. 

# Features

* Synchronous and Asynchronous methods for connection, query and fetch data;
* Support of Firebird Events (post_event statement);
* Covered with tests in nodeunit;
* blob field support;
* blob stream compatible to node stream class;
* prepared statements;

As for now in plans are:

* connection pool support;
* prepared statements pool;
* transaction parameters support;
* continous refactoring;
* more tests;
* services api.

# Getting Started


##Under Linux
You will need:
 NodeJS (tested with v0.6.0)
 Firebird (tested with v2.5)

 All things below were tested on CentOS 5.5.
 
Get Firebird:
 
    wget http://downloads.sourceforge.net/project/firebird/firebird-linux-i386/2.5-Release/FirebirdCS-2.5.0.26074-0.i686.rpm 
    rpm -ivh FirebirdCS-2.5.0.26074-0.i686.rpm 

Update your path: 
    export PATH=$PATH:/opt/firebird/bin

Create some Database: 

    isql -user sysdba -password <PASSWORD>key
    CREATE DATABASE 'test.fdb';
    CONNECT 'test.fdb';
    CREATE TABLE TEST (id integer, name varchar(50));
    exit;

Clone repository and build module

    git clone git://github.com/xdenser/node-firebird-libfbclient.git
    node-waf configure build
    node-waf configure install
    
or use npm:
    
    npm install firebird

To run tests update ./tests/config.js with your test database connection parameters and

    git submodule update --init
    node-waf test
     
Play with it from node:

    var fb  = require("./firebird");
    sys = require("sys"); 
    var con = fb.createConnection();
    con.connectSync('test.fdb','sysdba','masterkey','');
    con.querySync("insert into test (id,name) values (5, 'new one')");
    var res = con.querySync("select * from test");
    con.commitSync();
    var rows = res.fetchSync("all",true);
    console.log(sys.inspect(rows));

Check also samples directory.    

##Under Windows

[Experimental build for Windows](http://www.xdenser.com/downloads/node-firebird-win.zip)
Unzip, modify config.js for your DB. Run:
    node.exe test.js
   

# Links

- [node.js and firebird installing on Amazon EC2 instance](http://mapopa.blogspot.com/2011/01/nodejs-and-firebird-installing-on.html) on Mariuz's Blog
- [Catch Firebird events with Node.js](http://www.king-foo.be/2011/07/catch-firebird-events-with-node-js) on www.king-foo.be 
- [NodeJS home](http://nodejs.org)
- [Collection of NodeJS modules](https://github.com/joyent/node/wiki/modules)
 
# Reference

 createConnection() method will create Firebird Connection object for you
 
## Connection object

Handles database connection and queries. Supports Synchronous and Asynchronous operation.

### Connection object members
* * *
    function connectSync(database, username, password, role);

{'fraction_non_alphanumeric': 0.1068488351725346, 'fraction_numerical': 0.018216850586792784, 'mean_word_length': 3.774247491638796, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6552816', 'n_tokens_mistral': 1861, 'n_tokens_neox': 1730, 'n_words': 553}