Connection.find

Returns an array of the specified type, filtered with the given filter and params

If no rows are returned by PostgreSQL, an empty array is returned.

struct Connection
T[]
find
(
T
U...
)
(
string filter = ""
,
U vals = U.init
)

Examples

1 Connection conn; // An established connection
2 struct User
3 {
4 	@serial @PKey int id;
5 	string username;
6 	int posts;
7 };
8 
9 auto users = conn.find!User("username = $1 OR posts > $2", "foo", 42);
10 foreach (u; users)
11 {
12 	... // do something
13 }

Meta