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:

committed by
GitHub

parent
041e90b2e2
commit
a13b8ff0c8
@ -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 {
|
||||
|
Reference in New Issue
Block a user