2021-01-02 14:09:20 +01:00
|
|
|
import mysql
|
2019-11-18 00:34:46 +01:00
|
|
|
|
|
|
|
fn main() {
|
2021-01-02 14:09:20 +01:00
|
|
|
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()
|
|
|
|
}
|