79 lines
1.9 KiB
Plaintext

/* DBConnectionPool
DBConnectionPool specifies a common SPI for a database connection.
Each implementation is expected to require impl-specific properties
in the constructor.
*/
/* DBConnectionPool constructor.
IMMEDIATE.
Does not perform any IO.
Throws an exception if the Properties object is invalid.
*/
DBConnectionPool(Properties connectionProperties);
/* connect(function(error, DBConnectionPool) callback)
ASYNC.
Connect to the database, using the properties supplied in the constructor.
*/
connect(callback);
/* DBConnectionPool.isConnected() method.
IMMEDIATE.
Returns bool true/false
*/
isConnected();
/* DBConnectionPool.close() method.
ASYNC.
Upon close, the user's callback function will be called with no arguments.
*/
close(function() callback);
/* getDBSession().
ASYNC.
Creates and opens a new DBSession.
*/
getDBSession(session_index, function(error, DBSession) callback);
/* listTables(databaseName, callback(error, array))
ASYNC
List all tables in the schema.
Returns an array of table names.
*/
listTables(dbSession, databaseName, callback);
/* registerTypeConverter
IMMEDIATE
Register a converter for a SQL data type
If converterObject is null, *unregister* the typeConverter for this
data type.
@param typeName is a column type as defined in TableMetadata
@param converterObject is as defined in Converter
*/
registerTypeConverter(typeName, converterObject);
/* getTableMetadata
ASYNC.
Get metadata for a table. Return a TableMetadata object.
@param databaseName database name
@param tableName table name
@param DBSession if null, get a session just for this function
*/
getTableMetadata(databaseName, tableName, DBSession, function(err, TableMetadata) callback)
/* createTable
ASYNC.
Creates a table based on a table mapping.
*/
createTable(tableMapping, function(err) callback);