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

1 Connection conn; // An established connection
2 struct User 
3 {
4 	@serial8 @PKey long id;
5 	string username;
6 	byte[] passwordHash;
7 };
8 
9 struct Article { ... };
10 
11 conn.ensureSchema!(User, Article);

Meta