Connection.findL

Returns an array of the specified type, filtered with the given filter and params with length limited by limit

If no rows are returned by PostgreSQL, an empty array is returned. If limit is set to -1 then all filtered rows are returned.

struct Connection
T[]
findL
(
T
U...
)
(
string filter
,
int limit
,
)

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.findL!User("username = $1 OR posts > $2", 5, "foo", 42);
10 foreach (u; users)
11 {
12 	... // do something
13 }

Meta