cruisercoder / dstddb

A proposed standard database interface and library for D
MIT License
28 stars 10 forks source link

std.database.sqlite.database.connection c nnot deduce function from argument types #8

Open bubnenkoff opened 8 years ago

bubnenkoff commented 8 years ago

auto db = createDatabase("file:///" ~ sqlLiteDBName).query("CREATE TABLE IF NOT EXISTS MySyncData (guid text, id integer, name text, fl integer)"); auto con = db.connection();
Output:
source\app.d(104,28): Error: template std.database.sqlite.database.connection cannot deduce function from argument types !()(Result!(DefaultPolicy)), candidate are: \packages\dstddb-0.0.3\dstddb\src\std\dtabase\sqlite\database.d(31,6): std.database.sqlite.database.connection()(Database!T db, string source = "") dmd failed with exit code 1.

cruisercoder commented 8 years ago

The db variable assignment should not include the query. Here's a improvement:

auto db = createDatabase("file://t.db"); db.query("CREATE TABLE IF NOT EXISTS MySyncData (guid text, id integer, a integer)"); auto con = db.connection();