DBCommand class

A DB command.

Inheritance
Implemented types

Constructors

DBCommand.new(String host, int port, String user, String pass, String db, String software, List<SQL> sqls, {Map<String, dynamic>? properties, String? id})
DBCommand.fromJson(Map<String, dynamic> json)
Creates a DBCommand from a JSON Map.
factory

Properties

commandType String
The type of the command. Disposes the command resources.
no setteroverride
credential DBConnectionCredential
Returns the DBConnectionCredential.
no setter
db String
final
executedSqls List<SQL>
Returns a List of SQLs already executed.
no setter
executionGroup String
The execution group of the command.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
host String
final
id String
final
logError CommandLogError?
Logs an ERROR message.
getter/setter pairinherited
logInfo CommandLogInfo?
Logs an INFO message.
getter/setter pairinherited
pass String
final
port int
final
properties Map<String, dynamic>
final
requiredVariables List<String>
A list of required variables.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
software String
final
sqls List<SQL>
final
user String
final

Methods

dispose(DB<DBConnection>? prepared) Future<void>
Dispose this command resources and prepared instance.
override
execute({DB<DBConnection>? prepared, Map<String, dynamic>? properties}) Future<bool>
Executes the command and returns true if successful.
override
executeSQLs(List<SQL> sqls, {DB<DBConnection>? prepared, Map<String, dynamic>? properties}) Future<bool>
getProperty(String key, {Map<String, dynamic>? properties}) → dynamic
Returns a property with key from DBCommand.properties or from the parameter properties.
getSQLByID(String sqlID) SQL?
Returns the SQL with sqlID from sqls.
getSQLsByIDs(List<String> sqlIDs) List<SQL>
Returns the SQLs with ids in sqlIDs from sqls.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openDB({Duration retryInterval = const Duration(seconds: 1), int maxRetries = 10, int maxConnections = 1}) Future<DB<DBConnection>?>
prepare({int maxRetries = 10}) Future<DB<DBConnection>?>
Prepared the command to be executed.
override
resolveSQLs(DB<DBConnection> db, {Map<String, dynamic>? properties}) Future<void>
sqlVariableResolver(DB<DBConnection> db, String variableName, {Map<String, dynamic>? properties}) Future<Object?>
toJson() Map<String, dynamic>
Converts this DBCommand to JSON.
toString() String
A string representation of this object.
inherited

Operators

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