Database.single

Execute a SQL statement from a file that takes a model parameter and returns a single row

Parameters

T

type to map parameters and columns to

path

path to SQL file

model T

model to map parameters and columns to

Return Value

Type: T

new instance of T with fields mapped to columns

Examples

class Model
{
    int id;
    @(bind("name")) string name;
}
auto model = new Model();
model.id = 4;
auto model = database.single!(Model, "queries/statement.sql", model);

Meta