Giter Site home page Giter Site logo

mysql-js's Introduction

Database Jones

Introduction

See our latest presentation [on slideshare] (http://www.slideshare.net/jdduncan/building-nodejs-applications-with-database-jones).

This package provides a fast, easy, and safe framework for building database applications in Node.js.

Here is an example using Database Jones to store a single object (a JSON literal) into an existing MySQL table:

var jones = require("database-jones");

var connectionProperties = new jones.ConnectionProperties("mysql");

jones.openSession(connectionProperties).then(
  function(session) {
    var user = { id: 1, name: "Database Jones"};
    return session.persist("user", user);
  }).
  then(function() { console.log("Complete"); }, console.trace).
  then(jones.closeAllOpenSessionFactories);

Key features include:

  • Simple API for create, read, update, delete
  • Bulk operations for high performance
  • Support for ACID transactions, both explicit and implicit
  • Flexible mapping from JavaScript objects to relational tables
  • A fluent Query language using domain model tokens
  • Default mapping of a relational table to a simple object
  • Projection of several related tables to a complex object structure
  • Asynchronous API using well-known node.js callback patterns
  • Promises/A+, allowing easier management of callbacks
  • Connection pooling, allowing in-process scale up

Quick Install

The whole project can be used directly from a github clone if core.symlinks is set to true.

git config --global --add core.symlinks true
git clone http://github.com/mysql/mysql-js

To use the mysql adapter, you will also need node-mysql. To use the ndb adapter, you need MySQL Cluster, and you must use node-gyp to build the C++ source code under jones-ndb.

Sample applications

Git Branches

The C++ code under jones-ndb code is specific to particular versions of node.js. Currently the master branch runs under Node.js 0.12. The nodejs-0.10 branch runs with Node.js 0.10.

More information

See the complete README.md file under database-jones

Directory Structure

  • database-jones

    Lightweight object mapping layer for SQL and NoSQL databases.

  • jones-mysql

    Jones adapter for MySQL. Licensed GPL v2. Requires node-mysql.

  • jones-ndb

    Native Jones adapter for MySQL Cluster. Licensed GPL v2. Uses the low-level NDBAPI for data operations, but requires jones-mysql for certain metadata operations such as creating tables.

  • jones-test

    A high-performance stand-alone test harness. Jones-test is able to manage concurrent and serial tests, run hundreds of tests per second, and run combined test suites from several projects (for instance, running both the common database-jones tests and the jones-mysql specific tests all from a single test driver).

  • jones-promises

    An implementation of Promises/A+ used by database-jones.

  • unified_debug

    A printf-style debug library providing a single diagnostic environment for both C and JavaScript.

  • perftest

    Contains jscrund, a simple benchmarking tool for Jones.

  • loader

    A data loader implemented as a Jones application

  • samples

    Sample code using Jones

  • shell

    A database command shell based on Jones

mysql-js's People

Contributors

jdduncan avatar

Watchers

 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.