arsd.database_generation

Helper functions for generating database stuff.

Note: this is heavily biased toward Postgres

Members

Classes

RecordNotFoundException
class RecordNotFoundException

Functions

associated
T associated(B base, Database db)

Finds the single row associated with a foreign key in base.

children
QueryBuilderHelper!(T[]) children(B base)

Gets all the children of that type. Specifically, it looks in T for a ForeignKey referencing B and queries on that.

find
auto find(Database db, int id)

Returns a given struct populated from the database. Assumes types known to this module.

insert
void insert(O t, Database db)
join
auto join()

It will return an aggregate row with a member of type of each table in the join.

save
void save(O t, Database db)

Structs

QueryBuilderHelper
struct QueryBuilderHelper(T)
where
template where(conditions...)

Templates

Meta