1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/examples/database/mysql.v

18 lines
272 B
V
Raw Normal View History

import mysql
2019-11-18 02:34:46 +03:00
fn main() {
mut conn := mysql.Connection{
host: 'localhost'
port: 3306
username: 'root'
password: ''
dbname: 'mysql'
}
conn.connect()?
res := conn.query('show tables')?
for row in res.rows() {
println(row.vals.join(', '))
}
conn.close()
}