cruddyorm

CruddyORM is a simple object relational mapping library for Postgresql and vibe.d.

Cruddiness: - It only supports one database. - It assumes that you only want to persist fields, not properties. - It assumes that the id field is a UUID named id. - It uses std.experimental.logger instead of vibe's logging. Vibe doesn't offer a topic-based logging configuration, so that wouldn't let the ORM be stricter about its logging than application code. - It doesn't do connection pooling.

Members

Functions

dbdelete
void dbdelete(T val)

Delete something from the database.

dbdelete
void dbdelete(UUID id)

Delete something from the database.

insert
void insert(ref T val)

Insert a new DB row.

query
auto query(string cmd, Args args)

Execute a query, parsing the results automatically.

saveOrUpdate
void saveOrUpdate(ref T val)

Update the value if it's already in the database, otherwise insert it.

update
void update(T val)

Update a DB row.

updateConn
void updateConn(Connection conn, T val)

Update a DB row with an existing connection.

Static variables

connectionString
string connectionString;

The connection string to connect to postgresql.

dblog
MultiLogger dblog;

The logger for the ORM. This is public so you can set its level separately. By default, it logs at warning and above.

Structs

Transient
struct Transient

Attribute to mark a field as transient (don't save it).

Meta