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

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
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 {