A session is the main user access path to the database. The
Session
class models such a session.
Press CTRL+C to copySession extends Context
Press CTRL+C to copygetMapping(Object parameter, Function(Object err, Object mapping) callback);
Get the mappings for a table or class.
The parameter
may be a table name, a
mapped constructor function, or a domain object. This function
returns a fully resolved
TableMapping
object.
Press CTRL+C to copyBatch createBatch()
Creates a new, empty batch for collecting multiple operations to be executed together. In an application, you can invoke this function similarly to what is shown here:
Press CTRL+C to copyvar nosql = require("mysql-js"); var myBatch = nosql.createBatch();
Press CTRL+C to copyArray listBatches():
Return an array whose elements consist of all current batches belonging to this session.
Press CTRL+C to copyTransaction currentTransaction();
Get the current Transaction
.
Press CTRL+C to copyvoid close(Function(Object error) callback);
Close this session. Must be called when the session is no longer needed.
Press CTRL+C to copyboolean isClosed();
Returns true if this session is closed.
Press CTRL+C to copyvoid setLockMode(String lockMode);
Set the lock mode for read operations. This takes effect
immediately and remains in effect until the session is closed or
this method is called again. lockMode
must be one of 'EXCLUSIVE'
,
'SHARED'
, OR 'NONE'
.
Press CTRL+C to copyArray listTables(databaseName, callback);
List all tables in database
databaseName
.
Press CTRL+C to copyTableMetadata getTableMetadata(String databaseName, String tableName, callback);
Fetch metadata for table tableName
in
database databaseName
.