database_repository library

Classes

Constraint
A constraint that can be used with the where clauses
Contains
Checks if the element in question implements a constains function and if given function returns true for value. If value is iterable it will check for each element
ContainsNot
Checks if the element in question implements a constains function and if given function returns false for value. If value is iterable it will check for each element
DatabaseAdapter
Base class for Database Implementations
DatabaseAdapterRegistry
Class for managing DatabaseAdapters
DatabaseRepository<T extends DatabaseStorable>
A repository for databases exposing utility functions to easily persist objects to a database in a database independent way
DatabaseStorable
interface for objects that can be stored in a database This class should also contain a from json constructor that allows to construct via an empty json
Equals
Checks if the element in question is equal to the given value
GreaterThan
Checks if the element in question implements a > operator and if given operator returns true for value.
GreaterThanOrEquals
Checks if the element in question implements a >= operator and if given operator returns true for value.
InList
Checks if the element in question is in the provided list
IsFalse
Checks if the element in question is a boolean and if it is false
IsFalsey
Checks if the element in question is falsey. The following are falsey:
IsNotNull
Checks if the element in question is not null IMPORTANT: to check if a key is not set use IsSet
IsNull
Checks if the element in question is null IMPORTANT: to check if a key is not set use IsUnset
IsSet
Checks if the element in question is set. IMPORANT: The value may be null. To check if it is set and not null use IsNotNull.
IsTrue
Checks if the element in question is a boolean and if it is false
IsTruthy
Checks if the element in question is truthy. The following are falsey:
IsUnset
Checks if the element in question is unset.
LessThan
Checks if the element in question implements a < operator and if given operator returns true for value.
LessThanOrEquals
Checks if the element in question implements a <= operator and if given operator returns true for value.
NotEquals
Checks if the element in question is not equal to the given value
NotInList
Checks if the element in question is not in the provided list
Query
An object containing all information about an Object that should be transfered to the Database.
QueryResult
The result of a Query
Serializer<T extends DatabaseStorable>
A Serializer that takes a fromJson constructor and used it for deserialization.
SerializerInterface<T extends DatabaseStorable>
A interface for serialization for database storable objects

Enums

QueryAction
Which action the query should execute

Mixins

QueryMixin<T extends DatabaseStorable>
A mixin providing methods on creating Queries

Typedefs

JSON = Map<String, dynamic>
A nice name form JSON objects.

Exceptions / Errors

AdapterAlreadyRegisteredException
Exception that is thrown when trying to register a DatabaseAdapter with a name that is already registered.
AdapterNameViolationException
Exception that is thrown when trying to register a DatabaseAdapter with a name that violates the allowed name scheme.
ConstraintUnsupportedException
An Exception indicating that a given Constraint is not supported for the given DatabaseAdapter
NoSuchAdapterException
Exception that is thrown when trying to fetch a DatabaseAdapter from the DatabaseAdapterRegistry that was not registered.
QueryFailedException
Exception that is thrown when using DatabaseRepository utility methods such as create and when the underlying Query failed
SerializationException
Exception that is thrown when using the SerializerInterface failed to de-/serialize a object