The database access. It is designed to used with access.

Inheritance
  • Object
  • PostgresqlAccess
  • DBAccess

Properties

agent → AccessAgent

read-only, inherited
conn Connection

The connection to the postgreSQL server.

read-only, inherited
dataset → Map<String, dynamic>

A map of application-specific data.

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
reader → AccessReader

read-only, inherited
rollingback → dynamic

A flag or a cause to indicate the access (aka., the transaction) shall be rolled back at the end.

read / write
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
slowSql → Duration

How long to consider the query or execution of a SQL statement is slow. If omitted, the value specified in configure is used.

read / write
tag → dynamic

Tags the next SQL statement in this access (aka., transaction). Once tagged, onTag will be called in the next invocation of query or execute. If onTag is not specified, the SQL statement is simply logged.

read / write
writer → AccessWriter

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

afterCommit(void task()) → void

Adds a task that will be executed after the transaction is committed successfully

afterRollback(void task(error)) → void

Adds a task that will be executed after the transaction is committed successfully

cache(Entity entity) → void

Caches the given entity.

inherited
clearCache() → void

Clear the cache.

inherited
delete(String otype, String oid) → Future<int>

Deletes the entity of the given oid.

execute(String sql, [ values ]) → Future<int>

Queues a command for execution, and when done, returns the number of rows affected by the SQL command.

get(String otype, String oid) → Entity

Returns the entity of the given OID, if it is stored in the cache. It always return null if the plugin doesn't support the cache.

inherited
insert(String otype, Map<String, dynamic> data, { Map<String, String> types, String append }) → Future

Inserts the entity specified in data. Note: all fields found in data are written. You have to remove unnecessary files by yourself, such as F_OTYPE.

load(Iterable<String> fields, Entity newInstance(String oid), String oid, [ int option ]) → Future<Entity>

Loads the entity by the given oid, or null if not found.

loadAllBy(Iterable<String> fields, Entity newInstance(String oid), Map<String, dynamic> whereValues, [ int option ]) → Future<List<Entity>>

Loads all entities of the given AND criteria. By AND, we mean it satisfies all values in whereValues.

loadAllWith(Iterable<String> fields, Entity newInstance(String oid), String whereClause, [ Map<String, dynamic> whereValues, String fromClause, String shortcut ]) → Future<List<Entity>>

Loads all entities of the given criteria (never null).

loadBy(Iterable<String> fields, Entity newInstance(String oid), Map<String, dynamic> whereValues, [ int option ]) → Future<Entity>

Loads the first entity of the given AND criteria. By AND, we mean it satisfies all values in whereValues.

loadWhile(Iterable<String> fields, Entity newInstance(String oid), bool test(Entity lastLoaded, List<Entity> loaded), String whereClause, [ Map<String, dynamic> whereValues, String fromClause, String shortcut ]) → Future<List<Entity>>

Loads entities while test returns true. It stops loading if all entities are loaded or test returns false.

loadWith(Iterable<String> fields, Entity newInstance(String oid), String whereClause, [ Map<String, dynamic> whereValues, String fromClause, String shortcut ]) → Future<Entity>

Loads the first entity of the given criteria, or returns null if none.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
query(String sql, [ values ]) → Stream<Row>

Queue a SQL query to be run, returning a Stream of rows.

queryAny(String sql, [ values ]) → Future<Row>

Returns the first result, or null if not found.

queryAnyBy(Iterable<String> fields, String otype, Map<String, dynamic> whereValues, [ int option ]) → Future<Row>

Queries fields of otype for the criteria specified in whereValues (AND-ed together), or null if not found.

queryAnyWith(Iterable<String> fields, String otype, String whereClause, [ Map<String, dynamic> whereValues, String fromClause, String shortcut ]) → Future<Row>

Returns the first result, or null if not found.

queryBy(Iterable<String> fields, String otype, Map<String, dynamic> whereValues, [ int option ]) → Stream<Row>

Queries fields of otype for the criteria specified in whereValues (AND-ed together).

queryWith(Iterable<String> fields, String otype, String whereClause, [ Map<String, dynamic> whereValues, String fromClause, String shortcut ]) → Stream<Row>

Queries fields of otype for the criteria specified in whereClause and whereValues.

toEntity(Row row, Iterable<String> fields, Entity newInstance(String oid)) → Future<Entity>

Instantiates an Entity instance to represent the data in row. If row is, this method will return new Future.value(null).

toString() → String

Returns a string representation of this object.

uncache(String otype, String oid) → void

Removes the caching of the entity of the given otype and oid.

inherited