SQL statement splitter breaks E'...' strings that contain a backslash-escaped quote
メンテナーはふだん 1 日以内に返信
@7ttp がすでに取り組んでいます。
2026年9月29日 から。
評価
この issue はまだ評価されていません。
説明
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
- Add a migration that contains
select E'it\'s; here';. - Run
supabase db pushagainst a database. - 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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
supabase/cli のほかの issue
-
🐛 Bug supabase/cli
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
db push applies migrations when the confirmation answer is not yes or no対応中かも @7ttp が 1 日前に担当しました。 オープン🐛 Bug supabase/cli
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
refactor
難易度 2/5 半日 初心者へのやさしさ 84/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OHDSI/Data2Evidence#3450 ·
メンテナーはふだん 2 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
redhat-developer/rhdh-plugin-export-overlays#4011 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
automation missing-model model-sync provider:ofox
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/models.dev#8421 ·
メンテナーはふだん 1 日以内に返信
-
SlackAdapter and TelegramAdapter are not assignable to Adapter under exactOptionalPropertyTypesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信