DormDB

High-level wrapper around a database. Through the driver implementation layer this handles connection pooling and distributes work across a thread pool automatically.

Use the (UFCS) methods

- select - update - insert

to access the database.

This struct cannot be copied, to pass it around, use ref or move. Once the struct goes out of scope or gets unset, the connection to the database will be freed.

Constructors

this
this(DBConnectOptions options)

Performs a Database connection (possibly in another thread) and returns the constructed DormDB handle once connected.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

insert
void insert(T value)
void insert(T[] value)

Database operation to INSERT a single value or multiple values when a slice is passed into insert.

rawSQL
RawSQLIterator rawSQL(const(char)[] queryString, ffi.FFIValue[] bindParams)

This function executes a raw SQL statement.

remove
bool remove(T instance)

Deletes the given model instance from the database.

remove
RemoveOperation!T remove()

Returns a builder struct that can be used to perform a DELETE statement in the SQL database on the provided Model table.

remove
bool remove(TPatch instance)

Deletes the given model instance from the database.

startTransaction
DormTransaction startTransaction()

Starts a database transaction, on which most operations can be called.

update
UpdateOperation!T update()

Returns a builder struct that can be used to perform an UPDATE statement in the SQL database on the provided Model table.

Meta