chore: update slonik to the latest version - #8225
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades Slonik to version 49.10.7, which allows removing the custom Slonik patch file and configuring tracing: false directly in the database pool options. It also introduces an InferColumnValue helper type to simplify type signatures. Feedback was provided regarding InferColumnValue not being distributive over union types, which could cause it to resolve to unknown for nullable schema outputs, along with a suggestion to use a distributive helper type.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| type InferColumnValue<T extends StandardSchemaV1> = | ||
| StandardSchemaV1.InferOutput<T> extends Record<string, unknown> | ||
| ? StandardSchemaV1.InferOutput<T>[keyof StandardSchemaV1.InferOutput<T>] | ||
| : unknown; |
There was a problem hiding this comment.
If StandardSchemaV1.InferOutput<T> is a union type (e.g., { id: string } | null), the conditional type StandardSchemaV1.InferOutput<T> extends Record<string, unknown> is not distributive because StandardSchemaV1.InferOutput<T> is not a naked type parameter. This causes the type to resolve to unknown instead of distributing over the union (e.g., string | null).
Using a distributive helper type resolves this issue and preserves type safety for union or nullable schema outputs.
type DistributiveInferColumnValue<O> = O extends Record<string, unknown>
? O[keyof O]
: O extends null | undefined
? O
: unknown;
type InferColumnValue<T extends StandardSchemaV1> = DistributiveInferColumnValue<
StandardSchemaV1.InferOutput<T>
>;|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tags: |
Update slonik to the latest version, which reduces our need for patching the library to disable tracing.