mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
db, json, time, term: change optional to result (#16201)
This commit is contained in:
@ -8,8 +8,8 @@ fn main() {
|
||||
password: ''
|
||||
dbname: 'mysql'
|
||||
}
|
||||
conn.connect()?
|
||||
res := conn.query('show tables')?
|
||||
conn.connect()!
|
||||
res := conn.query('show tables')!
|
||||
for row in res.rows() {
|
||||
println(row.vals.join(', '))
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import sqlite
|
||||
|
||||
fn main() {
|
||||
db := sqlite.connect(':memory:')?
|
||||
db := sqlite.connect(':memory:')!
|
||||
db.exec("create table users (id integer primary key, name text default '');")
|
||||
|
||||
db.exec("insert into users (name) values ('Sam')")
|
||||
|
Reference in New Issue
Block a user