pure Javascript MySQL network driver for node.js
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit ahead, 46 commits behind masuidrive:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
LICENSE
README.md
example.js

README.md

node-mysql

node-mysql is pure Javascript MySQL network driver for node.js

Current status

It isn't for application development and production yet.

Now It can use for this driver developer only :-p

I'll work for more tests and documents.

Plan

I'll release to developer at middle March 2010.

Example

var sys = require('sys');
var mysql = require('./lib/mysql');

/*
> mysql -u root
CREATE DATABASE nodejs_mysql;
GRANT ALL ON nodejs_mysql.* TO nodejs_mysql@localhost IDENTIFIED BY "nodejs_mysql";
*/
var conn = new mysql.Connection();
conn.connect('localhost','nodejs_mysql', 'nodejs_mysql', 'nodejs_mysql');
conn.query("CREATE TEMPORARY TABLE test1(intval INTEGER, strval TEXT, timestampval TIMESTAMP, boolval BOOLEAN);");
conn.query("INSERT INTO test1 VALUES(1,'a',now(),true);");
conn.query("SELECT * FROM test1;",
    function(result) {
        for(var i=0; i<result.records.length; ++i) {
            sys.puts("Result: "+sys.inspect(result.toHash(result.records[i])));
        };
    },
    function(error) {
        sys.puts("Error: "+sys.inspect(error));
    });

Requirements

  • node.js > 0.1.29 (Supported 0.1.30)

Optional:

License

MIT License. See LICENSE file.

Who?

Code by Yuichiro MASUI a.k.a. masuidrive

Included files

MySQL protocol encode/decode from tmtm's ruby-mysql.

Promise library

  • http://nodejs.org/
  • Copyright 2009, 2010 Ryan Lienhart Dahl. All rights reserved.
  • License: MIT

SHA1 library from Takanori Ishikawa.

pack/unpack from php.js