oceandrift.db.orm

Object-Relational Mapping (ORM)

Members

Enums

asc (from oceandrift.db.dbal.v4)
anonymousenum asc via public import oceandrift.db.dbal.v4 : asc, desc, distinct, where, whereNot, whereParentheses;
columnName
eponymoustemplate columnName(string fieldName)

Determines the associated column name for a field of an entity type

fieldNames
eponymoustemplate fieldNames(alias TEntity)
Undocumented in source.
fieldNamesNoID
eponymoustemplate fieldNamesNoID(alias TEntity)
Undocumented in source.

Functions

get
bool get(DatabaseDriver db, ulong id, TEntity output)

Loads an entity from the database

map
EntityCollection!TEntity map(DatabaseDriver db, BuiltPreCollection!TEntity builtPreCollection)

Retrieves and maps data to the corresponding entity type

prepareCollection
PreparedCollection!TEntity prepareCollection(BuiltPreCollection!TEntity builtPreCollection, DatabaseDriver db)
Undocumented in source. Be warned that the author may not have intended to support it.
toEntities
EntityCollection!TEntity toEntities(Statement stmt)

Transforms a statement’s result rows into a collection of entities

toEntity
TEntity toEntity(Row row)

Transforms a result row into an instance of the specified entity type

via
EntityCollection!TEntity via(BuiltPreCollection!TEntity builtPreCollection, DatabaseDriver db)

Executes a built query via the provided database connection

where (from oceandrift.db.dbal.v4)
Query where(Query q, string column, TComparisonOperator op, T value) via public import oceandrift.db.dbal.v4 : asc, desc, distinct, where, whereNot, whereParentheses;
whereParentheses (from oceandrift.db.dbal.v4)
Query whereParentheses(Query q, Query delegate(Query q) @(safe) pure conditions) via public import oceandrift.db.dbal.v4 : asc, desc, distinct, where, whereNot, whereParentheses;

Imports

desc (from oceandrift.db.dbal.v4)
public import oceandrift.db.dbal.v4 : asc, desc, distinct, where, whereNot, whereParentheses;

Mixin templates

EntityID
mixintemplate EntityID()

Mixin template to add the entity ID member to a type

Structs

BuiltPreCollection
struct BuiltPreCollection(TEntity)

Compiled query statement to use with the ORM

EntityCollection
struct EntityCollection(TEntity)

Collection of entities (retrieved through a query)

EntityManager
struct EntityManager(DatabaseDriver)

Entity Manager

PreCollection
struct PreCollection(TEntity, DatabaseDriver)

ORM Query Builder

PreparedCollection
struct PreparedCollection(TEntity)

Templates

whereNot (from oceandrift.db.dbal.v4)
template whereNot(bool logicalJunction = or, TComparisonOperator) via public import oceandrift.db.dbal.v4 : asc, desc, distinct, where, whereNot, whereParentheses;

Variables

distinct (from oceandrift.db.dbal.v4)
enum Distinct distinct; via public import oceandrift.db.dbal.v4 : asc, desc, distinct, where, whereNot, whereParentheses;
isEntityType
enum bool isEntityType(TEntity);

Determines whether a type is an entity type suitable for ORM use

isORMCompatible
enum bool isORMCompatible(Driver);

Determines whether a Database Driver is compatible with the ORM

joinTableName
enum string joinTableName(alias TEntity1, alias TEntity2);

Determines the associated join table name for two entity types

tableName
enum string tableName(alias TEntity);

Determines the associated table name for an entity type

Meta