diff --git a/cmd/tools/vcreate.v b/cmd/tools/vcreate.v index 5422e48c3e..d842a72821 100644 --- a/cmd/tools/vcreate.v +++ b/cmd/tools/vcreate.v @@ -304,7 +304,7 @@ fn (mut c Create) set_web_project_files() { import db.sqlite // can change to 'db.mysql', 'db.pg' pub fn create_db_connection() !sqlite.DB { - mut db := sqlite.connect('vweb.sql')! + mut db := sqlite.connect('app.db')! return db } " @@ -500,7 +500,7 @@ fn (mut app App) service_auth(username string, password string) !string { } defer { - db.close() or { panic('fail to close database') } + db.close() or { panic(err) } } user := sql db { diff --git a/examples/vweb_fullstack/src/auth_services.v b/examples/vweb_fullstack/src/auth_services.v index dfffe7d9b7..28861f2f03 100644 --- a/examples/vweb_fullstack/src/auth_services.v +++ b/examples/vweb_fullstack/src/auth_services.v @@ -31,7 +31,7 @@ fn (mut app App) service_auth(username string, password string) !string { } defer { - db.close() or { panic('fail to close database') } + db.close() or { panic(err) } } user := sql db { diff --git a/examples/vweb_fullstack/src/databases/config_databases_sqlite.v b/examples/vweb_fullstack/src/databases/config_databases_sqlite.v index efb90c92cf..df58d89af6 100644 --- a/examples/vweb_fullstack/src/databases/config_databases_sqlite.v +++ b/examples/vweb_fullstack/src/databases/config_databases_sqlite.v @@ -3,6 +3,6 @@ module databases import db.sqlite // can change to 'db.mysql', 'db.pg' pub fn create_db_connection() !sqlite.DB { - mut db := sqlite.connect('vweb.sql')! + mut db := sqlite.connect('app.db')! return db } diff --git a/vlib/v/tests/orm_stmt_wrong_return_checking_test.v b/vlib/v/tests/orm_stmt_wrong_return_checking_test.v index 0102d88f87..9ccfbbf413 100644 --- a/vlib/v/tests/orm_stmt_wrong_return_checking_test.v +++ b/vlib/v/tests/orm_stmt_wrong_return_checking_test.v @@ -7,7 +7,7 @@ pub mut: } fn add_target(repo Target) !int { - mut dbs := sqlite.connect('test.db')! + mut dbs := sqlite.connect(':memory:')! defer { dbs.close() or { panic(err) } }