mirror of
https://github.com/jackc/pgx.git
synced 2025-05-28 10:12:08 +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
|
||||
}
|
||||
|
||||
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 {
|
||||
Name string `json:"name"`
|
||||
Age int `json:"age"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user