The fetch_types: false option breaks the serializing/parsing of array types. As an example, the following fails:
import postgres from 'postgres'
const sql = postgres({
fetch_types: false
})
const result = await sql`SELECT * FROM unnest(${['foo', 'bar']}::TEXT[])`
// Throws: `PostgresError: malformed array literal: "foo,bar"`
It would be nice to have the option to pass static typeOID -> arrayTypeOID mappings in the options to have that work without incurring the cost of fetching the OIDs from the database.
An automatic fallback with standard type OIDs could also be an option with fetch_types: false considering these appear to be stable?
The
fetch_types: falseoption breaks the serializing/parsing of array types. As an example, the following fails:It would be nice to have the option to pass static
typeOID -> arrayTypeOIDmappings in the options to have that work without incurring the cost of fetching the OIDs from the database.An automatic fallback with standard type OIDs could also be an option with
fetch_types: falseconsidering these appear to be stable?