porsager / porsager/postgres

Using type for unknown instead of any

Open
#1,113 0 comments 1 reaction 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

Currently the type of sql is:

  interface Row {
    [column: string]: any;
  }

  type MaybeRow = Row | undefined;

For type safety sake can it by unknown by default?

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 by locating the Row interface and MaybeRow type shown in the issue, then inspect how the sql result type is exposed. Completion means the default column value type is unknown rather than any, with the surrounding type definitions still compiling; the payload names no test file or runnable entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, typescript
Domain
databases
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.