Skip to content

Fetch custom type oids - use case: pgvector extension #1115

@haikyuu

Description

@haikyuu

In order to use vector type of the pgvector extension, we currently need to start a temporary connection to the db to get the vector type oid and then add it in the options types. See #1041

Similar to fetchArrayTypes, it should be possible to get the oid to fill to and from properties of the custom type and thus make it look like this

let options = {
  types: {
    vector: {
      serialize: v => JSON.stringify(v),
      parse: v =>JSON.parse(v)
     }
  }
}

This OID lookup would only happen for types that don't have to and from defined. Or maybe only under a flag in the type definition: fetch_oid: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions