这是我的旧代码:
cardinalPoints := []string{"75101", "75110", "75112", "75115", "92062"}
query = `SELECT * FROM "DataCom_travel" WHERE ((com1 = $1 AND com2 IN ($2)) OR (com1 IN ($2) AND com2 = $1));`
err := db.Select(&dataComTravel, query, "92050", pq.Array(cardinalPoints))
如何用 pgx 做到这一点?
pgx.Array 似乎不起作用。