Db class

Implemented types

Constructors

Db.fromEnv()
factory
Db.fromSettings(ConnectionSettings settings)
factory
Db.fromSettingsNoDatabase(ConnectionSettings settings)
factory

Properties

connection → MySQLConnection
no setter
hashCode int
The hash code for this object.
no setterinherited
id int
latefinaloverride-getter
inTransaction bool
getter/setter pairoverride-getter
logger → Logger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings ↔ ConnectionSettings
latefinal

Methods

close() Future<void>
override
connect() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rollback() Future<void>
test() Future<bool>
override
toString() String
A string representation of this object.
inherited
transaction<R>(Future<R> action()) Future<R>
withResults<T>(String query, {required FutureOr<T> action(IResultSet rs), ValueList? values}) Future<T>
NEW: run a query, expose IResultSet to a callback, then free any PS. Use this for SELECTs (or any query) when callers need to read rows.

Operators

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

Static Properties

mysqlDatabaseKey String
getter/setter pair
mysqlHostKey String
getter/setter pair
mysqlPortKey String
getter/setter pair
queryCount int
getter/setter pair

Static Methods

getEnv(String key, {String? defaultValue}) String

Constants

mysqlPasswordKey → const String
mysqlUsernameKey → const String
mysqlUseSSLKey → const String