Skip to content

feat(database-client): carry a row type through prepare - #193

Merged
jamie-at-bunny merged 4 commits into
mainfrom
feat/database-client-prepare-generic
Aug 28, 2026
Merged

feat(database-client): carry a row type through prepare#193
jamie-at-bunny merged 4 commits into
mainfrom
feat/database-client-prepare-generic

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

No description provided.

@bunnynet-devops

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7ca96c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@bunny.net/database-client Patch
@bunny.net/database-adapter Patch
@bunny.net/database-shell Patch
@bunny.net/database-studio Patch
@bunny.net/database-shell-linux-x64 Patch
@bunny.net/database-shell-linux-arm64 Patch
@bunny.net/database-shell-darwin-x64 Patch
@bunny.net/database-shell-darwin-arm64 Patch
@bunny.net/database-shell-windows-x64 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -0,0 +1,5 @@
---
"@bunny.net/database-client": minor

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
"@bunny.net/database-client": minor
"@bunny.net/database-client": patch

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

This PR carries row types from prepare<T>() through statement execution and heterogeneous batches.

  • Makes Statement generic while preserving its row type through bind(), all(), first(), and run().
  • Maps each batch statement to its corresponding typed result.
  • Adds tests, documentation, exports, and a patch changeset for the new typing behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/database-client/src/client.ts Introduces generic statements and tuple-mapped batch results; the previously reported single-type and heterogeneous-batch inference gaps are addressed.
packages/database-client/src/client.test.ts Adds coverage for statement-level row propagation, call-site overrides, single typed batches, heterogeneous batches, and column reads.
packages/database-client/src/index.ts Exports the new BatchResults public type.
packages/database-client/README.md Documents statement-level row typing and per-statement batch inference.
.changeset/database-client-prepare-generic.md Records the database-client typing enhancement as a patch release.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[prepare&lt;T&gt;] --> S[Statement&lt;T&gt;]
  S --> B[bind]
  B --> E[all / first / run]
  E --> R[Rows or Result typed as T]
  S --> BA[batch tuple]
  BA --> BR[Per-position BatchResults]
Loading

Reviews (3): Last reviewed commit: "fix(database-client): keep each statemen..." | Re-trigger Greptile

Comment thread packages/database-client/src/client.test.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: c28bcab6b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/database-client/src/client.ts Outdated
@jamie-at-bunny
jamie-at-bunny merged commit dca7b35 into main Aug 28, 2026
5 checks passed
@jamie-at-bunny
jamie-at-bunny deleted the feat/database-client-prepare-generic branch August 28, 2026 08:03
@github-actions github-actions Bot mentioned this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants