RelationMixin

Provides static methods for easy access to RelationProxy for the type this is used in. For docs on all the methods see RelationProxy's own docs.

mixin template RelationMixin () {}

Examples

1 struct User
2 {
3 	mixin RelationMixin;
4 
5 	@PK @serial int id;
6 	string username;
7 	ubyte[] password;
8 	int posts;
9 }
10 
11 auto firstUser = User.where(...).first;
12 auto nUpdated = User.where(...).updateAll(["posts": 123]);
13 auto userCount = User.where(...).count;

Meta