Skip to content

implement stateful connection#81

Merged
zhangyangyu merged 7 commits intomainfrom
support_stateful_connection
Feb 3, 2026
Merged

implement stateful connection#81
zhangyangyu merged 7 commits intomainfrom
support_stateful_connection

Conversation

@shiyuhang0
Copy link
Collaborator

No description provided.

@pingcap-cla-assistant
Copy link

pingcap-cla-assistant bot commented Jan 26, 2026

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot bot added the size/XXL label Jan 26, 2026
@shiyuhang0 shiyuhang0 force-pushed the support_stateful_connection branch from 4a686ec to 8709f7a Compare January 26, 2026 05:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements an experimental “stateful connection” mode for the TiDB Cloud Serverless JS driver, enabling session persistence across multiple queries.

Changes:

  • Add a Connection.persist() API returning a StatefulConnection wrapper with execute() and close().
  • Extend HTTP request handling to send a TiDB-Stateful-Action header to open/close stateful sessions.
  • Update integration tests and README documentation; bump package version to 0.3.0.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/version.ts Bumps internal driver version string to 0.3.0.
src/serverless.ts Adds TiDB-Stateful-Action header support to POST request helper.
src/index.ts Introduces persist()/StatefulConnection, adjusts transaction begin flow, and threads stateful action through execute path.
integration-test/basic.test.ts Adds integration tests for stateful connection open/close behavior.
README.md Documents stateless vs stateful vs transaction usage; adds notes/constraints.
package.json Bumps npm package version to 0.3.0.
pnpm-lock.yaml Adds a pnpm lockfile to the repo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ti-chi-bot ti-chi-bot bot added size/L and removed size/XXL labels Feb 3, 2026
@zhangyangyu zhangyangyu merged commit 75661fa into main Feb 3, 2026
5 checks passed
@zhangyangyu zhangyangyu deleted the support_stateful_connection branch February 3, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants