mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: cleanup sqlite.connect statements (do not leave strange test.db or vweb.sql artefacts around, after running common tests)
This commit is contained in:
parent
36834be2ad
commit
bee355eb65
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user