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

17 lines
256 B
V

import db.mysql
fn main() {
mut conn := mysql.connect(
host: 'localhost'
port: 3306
username: 'root'
password: ''
dbname: 'mysql'
)!
res := conn.query('show tables')!
for row in res.rows() {
println(row.vals.join(', '))
}
conn.close()
}