DartApiDB class abstract

The core interface for database access in DartAPI.

This abstract class defines a common API for SQL database interactions, such as querying, inserting, updating, and deleting data. Concrete implementations (e.g., for PostgreSQL or MySQL) must implement these methods.

The interface is designed to be simple and flexible, allowing developers to write database-agnostic code.

Implementers
Available extensions

Constructors

DartApiDB()

Properties

hashCode int
The hash code for this object.
no setterinherited
paramStyle DbParamStyle
The SQL parameter placeholder style used by this driver.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes the database connection.
connect() Future<void>
Establishes a connection to the database.
delete(String table, {required Map<String, dynamic> where}) Future<DbResult>
Deletes one or more rows from the specified table.
insert(String table, Map<String, dynamic> data) Future<DbResult>
Inserts a new row into the specified table.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(String table) QueryBuilder

Available on DartApiDB, provided by the DbQueryExtension extension

Returns a QueryBuilder targeting table.
rawQuery(String query, {Map<String, dynamic>? values}) Future<DbResult>
Executes a raw SQL query and returns the result.
select(String table, {Map<String, dynamic>? where}) Future<DbResult>
Retrieves data from the specified table.
toString() String
A string representation of this object.
inherited
transaction<T>(Future<T> callback(DbTransaction tx)) Future<T>
Runs callback inside a database transaction.
update(String table, Map<String, dynamic> data, {required Map<String, dynamic> where}) Future<DbResult>
Updates one or more rows in the specified table.

Operators

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