Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

SQL statement splitter breaks E'...' strings that contain a backslash-escaped quote

オープン
#6,885 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@7ttp がすでに取り組んでいます。

2026年9月29日 から。

評価

この issue はまだ評価されていません。

説明

🐛 Bug supabase/cli

Affected area: Migrations

Supabase CLI version: current develop (d38ccd7e)

Operating system: Any. Reproduced with a unit test on Linux.

Installation method: Built from source

Command

supabase db push

Actual output

A migration containing this statement fails with a syntax error:

select E'it\'s; here';

The CLI splits the statement at the semicolon inside the string literal and sends select E'it\'s and here' as two statements.

Expected behavior

The statement is sent as one statement. In an escape string constant, \' is an escaped quote and does not end the literal.

Steps to reproduce

  1. Add a migration that contains select E'it\'s; here';.
  2. Run supabase db push against a database.
  3. See the syntax error caused by the split statement.

Additional context

The splitter in apps/cli/src/command-internal/sql-split.ts only treats a doubled quote as an escape inside single-quoted strings. PostgreSQL also accepts backslash escapes in E'...' strings, so the first \' is read as the end of the literal. A unit test for splitAndTrim fails on develop and passes when backslash escapes are honored for escape string constants only. Standard strings such as 'a\' are unchanged. The same splitter is used by seed files and the declarative schema commands.

I have a fix with a unit test ready and can open a PR if this is open for contribution.

主要言語
TypeScript
スター
2.4k
フォーク
526
平均マージ
1日 2時間
マージ済み PR(30日)
307

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

supabase/cli のほかの issue

supabase/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。