planetscale / planetscale/database-js

Support for multiple statements?

Open
#85 16 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Apologies if this is already supported, but would it be possible to get the ability to run multiple statements in one request? Something like

await conn.execute("INSERT INTO foo(x) VALUES(12); SELECT LAST_INSERT_ID() as id;")

Obviously you can achieve that with separate queries, but that would require blocking until the insert is done, and then blocking while you grab the inserted id.

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 at the conn.execute entry point shown in the issue and read the comment thread to understand the intended multiple-statement behavior and constraints. Determine how one request should return results from both statements, then verify that the insert and LAST_INSERT_ID example works without requiring separate queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, typescript
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.