discontinuedPackage connect_database has been discontinued.

SqlCommand class

Constructors

SqlCommand(DatabaseConfig config, {QueryMetricsCallback? onMetrics})

Properties

commandText ↔ String?
getter/setter pair
eof → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
no setter
odbc → DatabaseDriver
final
recordCount → int
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schema ↔ SchemaUtils
latefinal
transaction ↔ SqlTransaction?
getter/setter pair

Methods

bulkDelete(String tableName, List ids, String idColumn, {int batchSize = 1000}) → Future<Result<int>>
Bulk deletes multiple records using WHERE IN clause. tableName - The table to delete from ids - List of ID values to delete idColumn - The column name to use as identifier (usually primary key) batchSize - Number of IDs to delete per batch (default: 1000)
bulkInsert(String tableName, List<Map<String, dynamic>> rows, {int? batchSize}) → Future<Result<int>>
bulkUpdate(String tableName, List<Map<String, dynamic>> updates, String whereColumn, {List<String>? updateColumns, int batchSize = 500}) → Future<Result<int>>
Bulk updates multiple records using CASE WHEN statement for efficient batch processing. tableName - The table to update updates - List of maps containing the data to update. Each map must contain whereColumn whereColumn - The column name to use as the identifier for updates (usually primary key) updateColumns - List of column names to update (if null, updates all columns except whereColumn) batchSize - Number of records to update per batch (default: 500)
clearParams() → void
close() → Future<Result<Unit>>
commit() → Future<Result<Unit>>
connect() → Future<Result<Unit>>
disableInterceptorForOpen() → void
disableInterceptorForStream() → void
disableReadUncommitted() → void
enableInterceptor() → void
enableReadUncommitted() → void
execute() → Future<Result<Unit>>
field(String name) → SqlTypeCommand
first() → void
isTransactionOpen() → bool
next() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offAutoCommit() → void
onAutoCommit() → void
open() → Future<Result<Unit>>
param(String name) → SqlTypeCommand
rollback() → Future<Result<Unit>>
startTransaction() → Future<Result<Unit>>
stream() → Future<Result<Stream<Map<String, dynamic>>>>
streamBuffered({int bufferSize = 100}) → Future<Result<Stream<List<Map<String, dynamic>>>>>
Streams data in batches to balance memory usage and performance. Ideal for very large datasets where you want to control memory footprint. bufferSize - Number of rows to fetch per batch (default: 100)
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaultBatchSize → const int