Coder Social home page Coder Social logo

mysql-js's Introduction

MySQL Cluster NoSQL API for Node.JS

INTRODUCTION

The NoSQL API for Node.JS provides a lightweight domain object model for JavaScript. You write code using common JavaScript objects, and use simple API calls to read and write those objects to the database, like this:

 var nosql = require("mysql-js");
 
 function onSession(err, session) {
   var data = new Tweet(username, message);
   session.persist(data);
 }

 nosql.openSession(onSession);

More sample code is available in the samples/ directory.

The API includes two backend adapters:

  • The "ndb" adapter, which uses the native NDB API to provide high-performance native access to MySQL Cluster.

  • The "mysql" adapter, which connects to any MySQL Server using the node-mysql driver, available from https://github.com/felixge/node-mysql/

REQUIREMENTS

Building the ndb backend requires an installed copy of MySQL Cluster 7.x including headers and shared library files. The MySQL architecture must match the node architecture: if node.js is 64-bit, then MySQL must also be 64-bit. If node is 32-bit, MySQL must be 32-bit.

The mysql backend requires version 2.0 of node-mysql, an all-JavaScript MySQL client.

WINDOWS REQURIREMENTS LIST

  1. Microsoft Visual Studio
  2. MySQL Cluster
  3. Python 2.6 or 2.7
  4. Node.JS
  5. node-gyp

BUILDING

The installation script is interactive. It will try to locate a suitable copy of MySQL, and it will prompt you to accept its choice or enter an alternative.

  • To build the module in place, type: node configure.js

  • After configuring, build a binary. The -d argument to node-gyp makes it a "debug" binary node-gyp configure build -d

  • After testing the debug binary, on platforms other than Windows, it is possible to build an optimized (non-debug) binary. Non-debug builds are generally not possible on Windows, and usually result in link-time errors. node-gyp rebuild

DIRECTORY STRUCTURE

API-documentation
Documentation of the main API
samples/
Sample code
setup/
Scripts used to build and install the adapter
test/
Test driver and test suite
Adapter/
The node.js adapter
Adapter/api
Implementation of the top-level API
Adapter/impl
Backend implementations

TESTING

The MySQL server must have the database "test" created. The test infrastructure currently relies on a mysql command-line client for creating and dropping tables, so the "mysql" executable must be in your command path.

To configure the servers and ports used for testing, edit test/test_connection.js

To run the test suite using the native NDB adapter:

    cd test
    node driver 

To run the test suite using the MySQL adapter:

   cd test
   node driver --adapter=mysql/ndb
   node driver --adapter=mysql/innodb

FOR MORE INFORMATION

See the issues and other information at http://github.com/mysql/mysql-js/

mysql-js's People

Contributors

jdduncan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.