porsager / porsager/postgres

Custom type handling does not work as documented

Open
#1,129 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
8.7k
Forks
374
Avg merge
11d 16h
Merged PRs (30d)
1

Description

From the docs for Custom Types:

An array of pg_types oids to handle when parsing values coming from the db.
from : [1337],

The actual behaviour is to apply blindly to all (not just the ones in the array) types matching to.

This creates a problem when trying to work around postgres.js's lack of handling for js Date() (equivalent to TIMESTAMPZ) to a postgressql DATE field. Perhaps there is a better way to handle that, but there does not appear to be anything relevant in the README.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Custom Types section in the README and trace the implementation that handles the from and to options. Verify the behavior with PostgreSQL custom type OIDs, including the documented [1337] example and the DATE/JavaScript Date use case; done means matching is limited to the requested types and the supported behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.