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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()
}