Fetch custom type oids - use case: pgvector extension
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8.7k
- Forks
- 374
- Avg merge
- 11d 16h
- Merged PRs (30d)
- 1
Description
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 https://github.com/porsager/postgres/issues/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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing fetchArrayTypes behavior and the custom types options described in the issue. Determine how missing to and from properties should trigger an OID lookup, then verify the result with the pgvector vector type example; done means custom types can serialize and parse without a temporary connection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, postgresql
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100