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

orm: fix mysql substructs (#9930)

This commit is contained in:
Louis Schmieder
2021-04-29 20:00:17 +02:00
committed by GitHub
parent ea0ac09297
commit b15156d465
3 changed files with 78 additions and 83 deletions

View File

@ -19,7 +19,13 @@ struct User {
}
fn main() {
db := sqlite.connect(':memory:') or { panic(err) }
sqlite3()
mysql()
psql()
}
fn sqlite3() {
mut db := sqlite.connect(':memory:') or { panic(err) }
sql db {
create table Module
}
@ -46,9 +52,7 @@ fn main() {
}
eprintln(modul)
// mysql()
psql()
db.close() or { panic(err) }
}
fn mysql() {
@ -82,7 +86,9 @@ fn mysql() {
m := sql conn {
select from Module where id == 1
}
eprintln(m)
conn.close()
}
fn psql() {
@ -117,4 +123,5 @@ fn psql() {
}
eprintln(modul)
db.close()
}