Database.list

Execute a SQL statement that takes a model parameter and returns many rows

Parameters

T

type to map parameters and columns to

sql string

SQL statement to execute

model T

model to map parameters and columns to

Return Value

Type: T[]

new array of T with the fields for each T mapped to columns

Examples

class Model
{
    int id;
    @(bind("name")) string name;
}
auto model = new Model();
model.name = "value";
auto models = database.list!(Model)("select * from models where name = ?(name);", model);

Meta