OdbcService class
High-level ODBC service that provides simplified API for database operations.
This service wraps IOdbcRepository to provide a more convenient interface for common database operations.
Usage
final service = OdbcService(repository);
await service.initialize();
final result = await service.executeQuery(
'SELECT * FROM users',
connectionId: connection.id,
);
- Implemented types
Constructors
- OdbcService(IOdbcRepository _repository)
- Creates a new OdbcService instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asyncCancel(
int requestId) → Future< Result< void> > -
override
-
asyncFree(
int requestId) → Future< Result< void> > -
override
-
asyncGetResult(
int requestId, {int? maxBufferBytes}) → Future< Result< QueryResult> > -
override
-
asyncPoll(
int requestId) → Future< Result< int> > -
override
-
beginTransaction(
String connectionId, {IsolationLevel? isolationLevel, SavepointDialect? savepointDialect, TransactionAccessMode? accessMode, Duration? lockTimeout}) → Future< Result< int> > -
override
-
bulkInsert(
String connectionId, String table, List< String> columns, List<int> dataBuffer, int rowCount) → Future<Result< int> > -
override
-
bulkInsertParallel(
int poolId, String table, List< String> columns, List<int> dataBuffer, int rowCount, {int parallelism = 0}) → Future<Result< int> > -
override
-
cancelStatement(
String connectionId, int stmtId) → Future< Result< void> > -
override
-
cancelStream(
int streamId) → Future< Result< void> > -
override
-
catalogColumns(
String connectionId, String table) → Future< Result< QueryResult> > -
override
-
catalogForeignKeys(
String connectionId, String table) → Future< Result< QueryResult> > -
override
-
catalogIndexes(
String connectionId, String table) → Future< Result< QueryResult> > -
override
-
catalogPrimaryKeys(
String connectionId, String table) → Future< Result< QueryResult> > -
override
-
catalogTables(
{required String connectionId, String catalog = '', String schema = ''}) → Future< Result< QueryResult> > -
override
-
catalogTypeInfo(
String connectionId) → Future< Result< QueryResult> > -
override
-
clearAllStatements(
) → Future< Result< void> > -
override
-
clearAuditEvents(
) → Future< Result< void> > -
override
-
clearMetadataCache(
) → Future< Result< void> > -
override
-
clearStatementCache(
) → Future< Result< void> > -
override
-
closeStatement(
String connectionId, int stmtId) → Future< Result< void> > -
override
-
commitTransaction(
String connectionId, int txnId) → Future< Result< void> > -
override
-
connect(
String connectionString, {ConnectionOptions? options}) → Future< Result< Connection> > -
override
-
createSavepoint(
String connectionId, int txnId, String name) → Future< Result< void> > -
override
-
detectDriver(
String connectionString) → Future< String?> -
override
-
disconnect(
String connectionId) → Future< Result< void> > -
override
-
dispose(
) → void -
override
-
executeAsyncStart(
String connectionId, String sql) → Future< Result< int> > -
override
-
executePrepared(
String connectionId, int stmtId, List? params, StatementOptions? options) → Future< Result< QueryResult> > -
override
-
executePreparedNamed(
String connectionId, int stmtId, Map< String, Object?> namedParams, StatementOptions? options) → Future<Result< QueryResult> > -
override
-
executeQuery(
String sql, {List? params, String? connectionId}) → Future< Result< QueryResult> > -
override
-
executeQueryDirectedParams(
String connectionId, String sql, List< DirectedParam> params) → Future<Result< QueryResult> > -
Like executeQueryParams for
OUT/INOUT(DRT1 on the wire).override -
executeQueryMulti(
String connectionId, String sql) → Future< Result< QueryResult> > -
override
-
executeQueryMultiFull(
String connectionId, String sql) → Future< Result< QueryResultMulti> > -
override
-
executeQueryMultiParams(
String connectionId, String sql, List params) → Future< Result< QueryResultMulti> > -
Executes a parameterised batch SQL and returns all multi-result items.
Up to 5 positional
?parameters are supported. New in v3.2.0.override -
executeQueryNamed(
String connectionId, String sql, Map< String, Object?> namedParams) → Future<Result< QueryResult> > -
override
-
executeQueryParams(
String connectionId, String sql, List params) → Future< Result< QueryResult> > -
override
-
getAuditEvents(
{int limit = 0}) → Future< Result< List< >Map< >String, Object?> > -
override
-
getAuditStatus(
) → Future< Result< Map< >String, Object?> > -
override
-
getConnectionDbmsInfo(
String connectionId) → Future< Result< DbmsInfo> > -
override
-
getDriverCapabilities(
String connectionString) → Future< Result< Map< >String, Object?> > -
override
-
getMetrics(
) → Future< Result< OdbcMetrics> > -
override
-
getPreparedStatementsMetrics(
) → Future< Result< PreparedStatementMetrics> > -
override
-
getVersion(
) → Future< Result< Map< >String, String> > -
override
-
initialize(
) → Future< Result< void> > -
override
-
isInitialized(
) → bool -
override
-
metadataCacheEnable(
{required int maxEntries, required int ttlSeconds}) → Future< Result< void> > -
override
-
metadataCacheStats(
) → Future< Result< Map< >String, Object?> > -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
poolClose(
int poolId) → Future< Result< void> > -
override
-
poolCreate(
String connectionString, int maxSize, {PoolOptions? options}) → Future< Result< int> > -
override
-
poolGetConnection(
int poolId) → Future< Result< Connection> > -
override
-
poolGetState(
int poolId) → Future< Result< PoolState> > -
override
-
poolGetStateDetailed(
int poolId) → Future< Result< Map< >String, Object?> > -
override
-
poolHealthCheck(
int poolId) → Future< Result< bool> > -
override
-
poolReleaseConnection(
String connectionId) → Future< Result< void> > -
override
-
poolSetSize(
int poolId, int newMaxSize) → Future< Result< void> > -
override
-
prepare(
String connectionId, String sql, {int timeoutMs = 0}) → Future< Result< int> > -
override
-
prepareNamed(
String connectionId, String sql, {int timeoutMs = 0}) → Future< Result< int> > -
override
-
releaseSavepoint(
String connectionId, int txnId, String name) → Future< Result< void> > -
override
-
rollbackToSavepoint(
String connectionId, int txnId, String name) → Future< Result< void> > -
override
-
rollbackTransaction(
String connectionId, int txnId) → Future< Result< void> > -
override
-
runInTransaction<
T extends Object> (String connectionId, Future< Result< action(int txnId), {IsolationLevel? isolationLevel, SavepointDialect? savepointDialect, TransactionAccessMode? accessMode, Duration? lockTimeout}) → Future<T> >Result< T> > -
Runs
actioninside a transaction with automatic commit on success and rollback on any failure (returnedFailureor thrown exception).override -
runInXaTransaction<
T extends Object> (String connectionId, Xid xid, Future< Result< action(XaTransactionHandle xa), {bool onePhase = false}) → Future<T> >Result< T> > -
Runs
actioninside a distributed XA / 2PC branch onconnectionId.override -
setAuditEnabled(
{required bool enabled}) → Future< Result< void> > -
override
-
setLogLevel(
int level) → Future< Result< void> > -
override
-
streamPollAsync(
int streamId) → Future< Result< int> > -
override
-
streamQuery(
String connectionId, String sql) → Stream< Result< QueryResult> > -
override
-
streamQueryMulti(
String connectionId, String sql) → Stream< Result< QueryResultMultiItem> > -
Streams a multi-result batch one item at a time. New in v3.3.0 (M8).
override
-
streamStartAsync(
String connectionId, String sql, {int fetchSize = 1000, int chunkSize = 64 * 1024}) → Future< Result< int> > -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
validateConnectionString(
String connectionString) → Future< Result< void> > -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited