SqlDatabase class abstract

An abstract base class for SQL-based database implementations.

This class provides shared implementations for common SQL operations like insert, select, update, and delete. Concrete subclasses are expected to implement the rawQuery method to execute the final query using the underlying database client.

Implemented types
Implementers

Constructors

SqlDatabase.new(DbConfig config)
Creates a new SQL database instance with the provided config.

Properties

config DbConfig
Configuration settings for the database connection.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes the database connection.
inherited
connect() Future<void>
Establishes a connection to the database.
inherited
delete(String table, {required Map<String, dynamic> where}) Future<DbResult>
Executes a DELETE query with a required WHERE clause.
override
insert(String table, Map<String, dynamic> data) Future<DbResult>
Executes an INSERT query and returns the result.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rawQuery(String query, {Map<String, dynamic>? values}) Future<DbResult>
Executes a raw SQL query.
override
select(String table, {Map<String, dynamic>? where, int? limit, int? offset}) Future<DbResult>
Executes a SELECT query with optional WHERE, LIMIT, and OFFSET clauses.
override
toString() String
A string representation of this object.
inherited
update(String table, Map<String, dynamic> data, {required Map<String, dynamic> where}) Future<DbResult>
Executes an UPDATE query with a required WHERE clause.
override

Operators

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