mirror of
https://github.com/jackc/pgx.git
synced 2025-05-29 18:53:50 +00:00
Fake example if PostgreSQL server too old for JSON
This commit is contained in:
parent
5ea6b04624
commit
65f5b33f3f
@ -12,6 +12,13 @@ func Example_JSON() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, ok := conn.PgTypes[pgx.JsonOid]; !ok {
|
||||||
|
// No JSON type -- must be running against very old PostgreSQL
|
||||||
|
// Pretend it works
|
||||||
|
fmt.Println("John", 42)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
type person struct {
|
type person struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Age int `json:"age"`
|
Age int `json:"age"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user