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

Connection conn; // An established connection
struct User
{
	@serial @PKey int id;
	string username;
	int posts;
};

auto users = conn.find!User("username = $1 OR posts > $2", "foo", 42);
foreach (u; users)
{
	... // do something
}

Meta