Database class

Database class, for MySQL

Constructors

Database({required String host, required int port, required String user, required String password, required String database, required DatabaseType type})
Constructor

Properties

conn ↔ MySQLConnection?
MySQLConnection
getter/setter pair
conn2 ↔ Connection?
PostgreSQLConnection
getter/setter pair
database String
Database name
final
hashCode int
The hash code for this object.
no setterinherited
host String
Host (e.g. 127.0.0.1)
final
password String
Password for the database
final
port int
Port for the host, e.g. 3600
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type DatabaseType
Database Type
final
user String
Username for the database
final

Methods

close() Future<void>
Closes the connection
connect() Future<void>
Connect to the database (MySQL ONLY)
exec(String query, [Map<String, dynamic>? args, bool? iterable = false]) Future
Executes a query Returns an IResultSet in case of MySQL and Returns Result in case of PostgreSQL iterable is only usable for MySQL
init() Future<void>
Inits the database
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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