db library
Beta SQLx-style DB annotations and runtime for Dust.
Classes
- BoolList
- A space-efficient list of boolean values.
-
CanonicalizedMap<
C, K, V> -
A map whose keys are converted to canonical values of type
C. - CaseInsensitiveEquality
- String equality that's insensitive to differences in ASCII case.
-
CombinedIterableView<
T> - A view of several iterables combined sequentially into a single iterable.
-
CombinedListView<
T> - A view of several lists combined into a single list.
-
CombinedMapView<
K, V> - Returns a new map that represents maps flattened into a single map.
- Connection
- Backwards-compatible single database connection name.
- CopyWith
-
Generates typed
copyWithsupport. - DatabaseClient
- Open generated application database facade.
- DatabaseConnection
- Open database connection.
- DatabaseExecutor
- Executes typed SQLx-style queries against a database connection, transaction, or driver.
- DatabaseTransaction
- Transaction-scoped database executor.
- Debug
-
Deprecated alias for
ToString(). - DeepCollectionEquality
- Deep equality on collections.
-
DefaultEquality<
E> - Equality of objects that compares only the natural equality of the objects.
-
DelegatingIterable<
E> - An Iterable that delegates all operations to a base iterable.
-
DelegatingList<
E> - A List that delegates all operations to a base list.
-
DelegatingMap<
K, V> - A Map that delegates all operations to a base map.
-
DelegatingQueue<
E> - A Queue that delegates all operations to a base queue.
-
DelegatingSet<
E> - A Set that delegates all operations to a base set.
- Derive
- Declares which traits Dust should generate for the annotated declaration.
- DeriveConfig
- Base marker for derive configuration annotations.
- DeriveMeta
- Base marker for all Dust derive annotations.
- DeriveTrait
-
Base marker for derive traits listed inside
@Derive([...]). - Eq
-
Generates value equality through
operator ==and matchinghashCode. -
Equality<
E> - A generic equality relation on objects.
-
EqualityBy<
E, F> - Equality of objects based on derived values.
-
EqualityMap<
K, V> - A Map whose key equality is determined by an Equality object.
-
EqualitySet<
E> - A Set whose key equality is determined by an Equality object.
-
Err<
T, E> - Failed operation result.
- ExecResult
- Result of a SQL execute statement.
- Executor
- Legacy name for DatabaseExecutor with explicit raw SQL access.
- FromRow
- Derive trait for a class that Dust can construct from one database row.
-
HeapPriorityQueue<
E> - Heap based priority queue.
-
IdentityEquality<
E> - Equality of objects that compares only the identity of the objects.
- Invalid
- Failed validation result.
-
IterableEquality<
E> - Equality on iterables.
-
IterableZip<
T> - Iterable that iterates over lists of values from other iterables.
- Length
- Type-safe length validator configuration.
-
ListEquality<
E> - Equality on lists.
-
ListSlice<
E> - A list view of a range of another list.
-
MapEquality<
K, V> - Equality on maps.
-
MapKeySet<
E> - An unmodifiable Set view of the keys of a Map.
-
MapValueSet<
K, V> - Creates a modifiable Set view of the values of a Map.
-
MultiEquality<
E> - Combines several equalities into a single equality.
-
None<
T> - Option state for an absent value.
-
NonGrowableListMixin<
E> - Mixin class that implements a throwing version of all list operations that change the List's length.
-
NonGrowableListView<
E> - A fixed-length list.
-
Ok<
T, E> - Successful operation result.
-
Option<
T> - Optional value wrapper for Rust-style present-or-absent values.
- Pool
- Backwards-compatible long-lived database pool name.
-
PriorityQueue<
E> - A priority queue is a priority based work-list of elements.
- Query
- Marks a generated SQL method inside a SqlxDao.
-
QueryAs<
T> - Typed row query.
- QueryExecute
- Statement query.
- QueryRaw
- Untyped row query.
-
QueryScalar<
T> - Scalar query returning the first selected column.
-
QueueList<
E> - A class that efficiently implements both Queue and List.
- Range
- Type-safe numeric range validator configuration.
- RawSql
- Explicit unchecked SQL access.
- RawSqlx
- Public unchecked SQL wrapper for app-level composition.
-
Result<
T, E> -
Result of an operation that can either succeed with
Tor fail withE. - Row
- Driver-agnostic typed view over one database result row.
- RowMapperRegistry
-
Process-wide row mapper registry populated by generated
FromRowcode. -
SetEquality<
E> - Equality of sets.
-
Some<
T> - Option state for a present value.
- Sqlx
- sqlx-style row/class mapping options.
- SqlxDao
- Marks a repository-style class for generated SQLx methods.
- SqlxDatabase
- Declares the top-level generated SQLx database open/configuration type.
-
SqlxTryFrom<
DartT, DbT> - Converts one database value into a Dart value during generated row mapping.
- ToString
-
Generates a
toString()implementation from the class fields. - Transaction
- Backwards-compatible transaction-scoped executor name.
-
UnionSet<
E> - A single set that provides a view of the union over a set of sets.
-
UnionSetController<
E> - A controller that exposes a view of the union of a collection of sets.
- Unit
- Empty success value for operations that only signal completion.
-
UnmodifiableListView<
E> - An unmodifiable List view of another List.
-
UnmodifiableMapMixin<
K, V> - Mixin class that implements a throwing version of all map operations that change the Map.
-
UnmodifiableMapView<
K, V> - View of a Map that disallow modifying the map.
-
UnmodifiableSetMixin<
E> - Mixin class that implements a throwing version of all set operations that change the Set.
-
UnmodifiableSetView<
E> - An unmodifiable set.
-
UnorderedIterableEquality<
E> - Equality of the elements of two iterables without considering order.
- Valid
- Successful validation result.
- Validatable
-
Runtime contract implemented by generated
Validate()mixins. -
Validate<
T> - Generates validation methods and configures field validators.
- ValidationError
- One validation failure.
- ValidationHelper
- Shared helpers used by generated validation code.
- ValidationResult
- Result returned by generated validation.
Enums
- Driver
- Supported Database driver targets.
- SqlxDatabaseType
- Supported SQLx database types.
- SqlxErrorCategory
- Broad category for one SQLx-style runtime error.
- SqlxRename
- sqlx-style field/class rename strategies.
Extensions
-
ComparatorExtension
on Comparator<
T> - Extensions on comparator functions.
- DatabaseClientExecution on DatabaseClient
- Convenience methods for generated application database facades.
-
IterableComparableExtension
on Iterable<
T> - Extensions that apply to iterables of Comparable elements.
-
IterableDoubleExtension
on Iterable<
double> - Extension on iterables of double.
-
IterableExtension
on Iterable<
T> - Extensions that apply to all iterables.
-
IterableIntegerExtension
on Iterable<
int> - Extension on iterables of integers.
-
IterableIterableExtension
on Iterable<
Iterable< T> > - Extensions on iterables whose elements are also iterables.
-
IterableNullableExtension
on Iterable<
T?> - Extensions that apply to iterables with a nullable element type.
-
IterableNumberExtension
on Iterable<
num> - Extensions that apply to iterables of numbers.
-
ListComparableExtensions
on List<
E> - Various extensions on lists of comparable elements.
-
ListExtensions
on List<
E> - Various extensions on lists of arbitrary elements.
- RowCompatibility on Row
- Compatibility helpers for generated code emitted before the Executor/Row naming cleanup.
Functions
-
binarySearch<
E> (List< E> sortedList, E value, {int compare(E, E)?}) → int -
Returns a position of the
valueinsortedList, if it is there. -
compareAsciiLowerCase(
String a, String b) → int -
Compares
aandblexically, converting ASCII letters to lower case. -
compareAsciiLowerCaseNatural(
String a, String b) → int -
Compares strings
aandbaccording to lower-case natural sort ordering. -
compareAsciiUpperCase(
String a, String b) → int -
Compares
aandblexically, converting ASCII letters to upper case. -
compareAsciiUpperCaseNatural(
String a, String b) → int -
Compares strings
aandbaccording to upper-case natural sort ordering. -
compareNatural(
String a, String b) → int -
Compares strings
aandbaccording to natural sort ordering. -
decodeJsonObject(
String source) → Map< String, Object?> - Decodes a JSON object stored in a text column.
-
equalsIgnoreAsciiCase(
String a, String b) → bool -
Checks if strings
aandbdiffer only on the case of ASCII letters. -
groupBy<
S, T> (Iterable< S> values, T key(S)) → Map<T, List< S> > -
Groups the elements in
valuesby the value returned bykey. -
hashIgnoreAsciiCase(
String string) → int - Hash code for a string which is compatible with equalsIgnoreAsciiCase.
-
insertionSort<
E> (List< E> elements, {int compare(E, E)?, int start = 0, int? end}) → void -
Sort a list between
start(inclusive) andend(exclusive) using insertion sort. -
lastBy<
S, T> (Iterable< S> values, T key(S)) → Map<T, S> -
Associates the elements in
valuesby the value returned bykey. -
lowerBound<
E> (List< E> sortedList, E value, {int compare(E, E)?}) → int -
Returns the first position in
sortedListthat does not compare less thanvalue. -
mapMap<
K1, V1, K2, V2> (Map< K1, V1> map, {K2 key(K1, V1)?, V2 value(K1, V1)?}) → Map<K2, V2> -
Creates a new map from
mapwith new keys and values. -
maxBy<
S, T> (Iterable< S> values, T orderBy(S), {int compare(T, T)?}) → S? -
Returns the element of
valuesfor whichorderByreturns the maximum value. -
mergeMaps<
K, V> (Map< K, V> map1, Map<K, V> map2, {V value(V, V)?}) → Map<K, V> -
Returns a new map with all key/value pairs in both
map1andmap2. -
mergeSort<
E> (List< E> elements, {int start = 0, int? end, int compare(E, E)?}) → void -
Sorts a list between
start(inclusive) andend(exclusive) using the merge sort algorithm. -
minBy<
S, T> (Iterable< S> values, T orderBy(S), {int compare(T, T)?}) → S? -
Returns the element of
valuesfor whichorderByreturns the minimum value. -
queryAs<
T> (String sql, List< Object?> parameters, {RowMapper<T> ? mapper}) → QueryAs<T> - Creates a typed row query helper.
-
queryExecute(
String sql, List< Object?> parameters) → QueryExecute - Creates an execute statement query helper.
-
queryRaw(
String sql, List< Object?> parameters) → QueryRaw - Creates a raw row query helper.
-
queryScalar<
T> (String sql, List< Object?> parameters) → QueryScalar<T> - Creates a scalar query helper.
-
registerRowMapper<
T> (RowMapper< T> mapper) → bool -
Registers a generated row mapper and returns
truefor top-level initializers. -
reverse<
E> (List< E> elements, [int start = 0, int? end]) → void - Reverses a list, or a part of a list, in-place.
-
shuffle(
List elements, [int start = 0, int? end, Random? random]) → void - Shuffles a list randomly.
-
stronglyConnectedComponents<
T> (Map< T, Iterable< graph) → List<T> >Set< T> > -
Returns the strongly connected components of
graph, in topological order. -
transitiveClosure<
T> (Map< T, Iterable< graph) → Map<T> >T, Set< T> > -
Returns the transitive closure of
graph.
Typedefs
- Dao = SqlxDao
- Backwards-compatible short DAO marker.
- Database = SqlxDatabase
- Backwards-compatible short database marker.
-
FieldValidator<
T> = ValidationError? Function(T value) -
Custom validator callback used by field-level
@Validate(custom: ...). -
RowMapper<
T> = T Function(Row row) - Converts one database row into a typed Dart object.
- SqlxDriver = DatabaseExecutor
- Backwards-compatible name for the DB execution contract.
Exceptions / Errors
- SqlxCardinalityError
- Error produced when a query returns the wrong number of rows.
- SqlxDecodeError
- Error produced while decoding a row into a Dart object.
- SqlxDriverError
- Error reported by a database driver.
- SqlxError
- Base class for Database SQLx-style runtime errors.
- ValidationException
-
Exception thrown by generated
validateOrThrow().