BuiltQuery

Built query as generated by a QueryBuilder

or in other words: the result of query building

// Construct an abstract query
Select query = table("mountain").qb.select(count("*"));

// Build the query with the query builder of your choice (e.g. [oceandrift.db.sqlite3.SQLite3] when using SQLite3)
BuiltQuery builtQuery = QueryBuilder.build(query);

// Prepare a statement from your query by calling [prepareBuiltQuery]
Statement stmt = db.prepareBuiltQuery(builtQuery);

stmt.execute();
// …
// More idiomatic way using UFCS:
BuiltQuery builtQuery = table("mountain").qb
    .select(count("*"))
    .build!QueryCompiler()
;

// Query building works during compile-time as well(!):
enum BuiltQuery bq = table("mountain").qb
    .select(count("*"))
    .build!QueryCompiler()
;
@safe pure
alias BuiltQuery = const(_BuiltQuery)

Meta