Connection.ensureSchema

Generates and runs the DDL from the given structures

Attributes from dpq.attributes should be used to define primary keys, indexes, and relationships.

A custom type can be specified with the @type attribute.

struct Connection
void
ensureSchema
(
T...
)
(
bool createType = false
)

Examples

Connection conn; // An established connection
struct User 
{
	@serial8 @PKey long id;
	string username;
	byte[] passwordHash;
};

struct Article { ... };

conn.ensureSchema!(User, Article);

Meta