Find file History
Latest commit e6aee63 Dec 3, 2016 @CraigLRussell CraigLRussell Improve usability of connect, openSession and createTable
  allow the mappings parameter to be optional with a callback
  allow the mappings parameter to be a TableMapping
  for createTable, generate SPARSE_FIELDS column

If a user specifies a TableMapping on connect, the mapping is cached in the
session factory and used for functions taking a String tableName.

If a user specifies a TableMapping on openSession, the mapping is cached in the
session and used for functions taking a String tableName.

If a user specifies a TableMapping on a specific function (e.g. find, persist),
the mapping is used only for that call and is not cached.

SessionFactory.js
  if there is only one parameter, and it a function (not a mapped constructor)
    then assume it is a callback
  allow openSession to cache a session-specific table handler
  allow openSession to use a TableMapping as a mapping parameter

Session.js
  add property tableHandlers to cache session-specific table handlers

SQLBuilder.js
  if there is a SPARSE_FIELDS definition, create its column with createTable

mappings
  add tests for improved mappings parameter support

ConnectTest.js
  jones.connect with callback but no table mapping
  jones.connect with table mapping and verify table handler is cached
    in session factory
  jones.openSession with table mapping and verify table handler is cached in session
  sessionFactory.openSession with table mapping and verify table handler is cached
    in sessionFactory
  jones.openSession with callback but no table mappings
  sessionFactory.openSession with callback but no table mappings

utilities.js
  rework fail_openSession for readability

TableMapping.js
  add “return this” to a couple of functions to allow function chaining

UserContext.js
  create new resolveTableMappings function that can be called from
    SessionFactory.openSession
  reorganize getTableHandler to allow table mappings to be used

jones.js
  allow openSession to cache a session-specific table handler
  allow openSession to use a TableMapping as a mapping parameter

README.md

Jones-MySQL

Introduction

Jones-MySQL is the Database Jones service provider for MySQL.

It supports any MySQL database and uses the all-JavaScript mysql connector https://github.com/felixge/node-mysql

Running and Testing Jones-MySQL

Running the test suite

To test that jones-mysql is fully installed:

  • cd test
  • By default, jones-mysql uses a MySQL servers at port 3306 on the local machine. In this case:
    • node driver
  • For some other configuration, define a deployment with appropriate connection properties in jones_deployments.js and use it:
    • node driver -E my_test_deployment

Test results

The final output from a succesful test run should look something like this:

Adapter:  mysql
Elapsed:  8.395 sec.
Started:  619
Passed:   617
Failed:   0
Skipped:  2

NDB Connection Properties

Each Jones Service Provider supports a different set of connection properties, based on the data source it supports. These properties, and their default values, are documented in the file DefaultConnectionProperties.js