mysql: fix for adapting mysql types to v structs (#15100)

This commit is contained in:
Hitalo de Jesus do Rosário Souza 2022-07-19 12:29:09 -03:00 committed by GitHub
parent 041e90b2e2
commit a13b8ff0c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 185 additions and 15 deletions

View file

@ -20,8 +20,11 @@
```v ignore
struct Foo {
id int [primary; sql: serial]
name string [nonull]
id int [primary; sql: serial]
name string [nonull]
created_at time.Time [sql_type: 'DATETIME']
updated_at string [sql_type: 'DATETIME']
deleted_at time.Time
}
```
@ -45,7 +48,10 @@ sql db {
```v ignore
var := Foo{
name: 'abc'
name: 'abc'
created_at: time.now()
updated_at: time.now().str()
deleted_at: time.now()
}
sql db {