OdbcNative class
Native ODBC bindings wrapper.
Provides a high-level Dart interface to the native ODBC engine through FFI bindings. Handles connection management, queries, transactions, prepared statements, connection pooling, and streaming.
Constructors
- OdbcNative()
- Creates a new OdbcNative 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
-
bulkInsertArray(
int connectionId, String table, List< String> columns, Uint8List dataBuffer, int rowCount) → int - Performs a bulk insert operation.
-
cancelStatement(
int stmtId) → bool - Cancels a prepared statement execution.
-
catalogColumns(
int connectionId, String table) → Uint8List? - Queries the database catalog for column information.
-
catalogTables(
int connectionId, {String catalog = '', String schema = ''}) → Uint8List? - Queries the database catalog for table information.
-
catalogTypeInfo(
int connectionId) → Uint8List? - Queries the database catalog for data type information.
-
closeStatement(
int stmtId) → bool - Closes and releases a prepared statement.
-
connect(
String connectionString) → int - Establishes a new database connection.
-
connectWithTimeout(
String connectionString, int timeoutMs) → int - Establishes a connection with a login timeout.
-
disconnect(
int connectionId) → bool - Closes and disconnects a connection.
-
dispose(
) → void - Disposes of native resources.
-
execQuery(
int connectionId, String sql, {int? maxBufferBytes}) → Uint8List? - Executes a SQL query and returns binary result data.
-
execQueryMulti(
int connectionId, String sql, {int? maxBufferBytes}) → Uint8List? - Executes a SQL query that returns multiple result sets.
-
execQueryParams(
int connectionId, String sql, Uint8List? params, {int? maxBufferBytes}) → Uint8List? - Executes a SQL query with binary parameters.
-
execQueryParamsTyped(
int connectionId, String sql, List< ParamValue> params, {int? maxBufferBytes}) → Uint8List? - Executes a SQL query with typed parameters.
-
execute(
int stmtId, [Uint8List? params]) → Uint8List? - Executes a prepared statement with optional binary parameters.
-
executeTyped(
int stmtId, [List< ParamValue> ? params]) → Uint8List? - Executes a prepared statement with typed parameters.
-
getError(
) → String - Gets the last error message from the native engine.
-
getMetrics(
) → OdbcMetrics? - Gets performance and operational metrics.
-
getStructuredError(
) → StructuredError? - Gets structured error information including SQLSTATE and native code.
-
init(
) → bool - Initializes the ODBC environment.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
poolClose(
int poolId) → bool - Closes the connection pool and releases all connections.
-
poolCreate(
String connectionString, int maxSize) → int - Creates a new connection pool.
-
poolGetConnection(
int poolId) → int - Gets a connection from the pool.
-
poolGetState(
int poolId) → ({int idle, int size})? - Gets the current state of the connection pool.
-
poolHealthCheck(
int poolId) → bool - Performs a health check on the connection pool.
-
poolReleaseConnection(
int connectionId) → bool - Releases a connection back to the pool.
-
prepare(
int connectionId, String sql, {int timeoutMs = 0}) → int - Prepares a SQL statement for execution.
-
savepointCreate(
int txnId, String name) → bool - Creates a savepoint within an active transaction.
-
savepointRelease(
int txnId, String name) → bool - Releases a savepoint. The transaction remains active.
-
savepointRollback(
int txnId, String name) → bool - Rolls back to a savepoint. The transaction remains active.
-
streamClose(
int streamId) → bool - Closes a streaming query.
-
streamFetch(
int streamId) → StreamFetchResult - Fetches the next chunk of data from a streaming query.
-
streamStart(
int connectionId, String sql, {int chunkSize = _defaultStreamChunkSize}) → int - Starts a streaming query.
-
streamStartBatched(
int connectionId, String sql, {int fetchSize = 1000, int chunkSize = 64 * 1024}) → int - Starts a batched streaming query.
-
toString(
) → String -
A string representation of this object.
inherited
-
transactionBegin(
int connectionId, int isolationLevel) → int - Begins a new transaction with the specified isolation level.
-
transactionCommit(
int txnId) → bool - Commits a transaction.
-
transactionRollback(
int txnId) → bool - Rolls back a transaction.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited