Skip to content

chore: update slonik to the latest version - #8225

Draft
n1ru4l wants to merge 1 commit into
mainfrom
chore-update-slonik-49.10.7
Draft

chore: update slonik to the latest version#8225
n1ru4l wants to merge 1 commit into
mainfrom
chore-update-slonik-49.10.7

Conversation

@n1ru4l

@n1ru4l n1ru4l commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Update slonik to the latest version, which reduces our need for patching the library to disable tracing.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +19 to +22
type InferColumnValue<T extends StandardSchemaV1> =
StandardSchemaV1.InferOutput<T> extends Record<string, unknown>
? StandardSchemaV1.InferOutput<T>[keyof StandardSchemaV1.InferOutput<T>]
: unknown;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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>
>;

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
hive 11.5.1-alpha-20260716093210-5ef6a87e5895f8cdb2526774f2749a6d8ad6a609 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.5.1-alpha-5ef6a87, 5ef6a87, 5ef6a87e5895f8cdb2526774f2749a6d8ad6a609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant