mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: bring back panic(err.msg)
-> panic(err)
(#9022)
This commit is contained in:
@ -16,7 +16,7 @@ struct User {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
db := sqlite.connect(':memory:') or { panic(err.msg) }
|
||||
db := sqlite.connect(':memory:') or { panic(err) }
|
||||
db.exec('drop table if exists User')
|
||||
db.exec("create table Module (id integer primary key, name text default '', nr_downloads int default 0, creator int default 0);")
|
||||
db.exec("create table User (id integer primary key, age int default 0, name text default '', is_customer int default 0);")
|
||||
@ -33,12 +33,12 @@ fn main() {
|
||||
sql db {
|
||||
insert mod into Module
|
||||
}
|
||||
|
||||
|
||||
modul := sql db {
|
||||
select from Module where id == 1
|
||||
}
|
||||
|
||||
println(modul.name)
|
||||
println(modul.creator.name)
|
||||
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ fn main() {
|
||||
|
||||
// by adding `limit 1` we tell V that there will be only one object
|
||||
println(dash)
|
||||
existing := db.select from Customer where id == 1 limit 1 or { panic(err.msg) }
|
||||
existing := db.select from Customer where id == 1 limit 1 or { panic(err) }
|
||||
println('Existing customer name: $existing.name')
|
||||
println('Existing customer full information:')
|
||||
println(existing)
|
||||
|
Reference in New Issue
Block a user