SQL statement splitter breaks E'...' strings that contain a backslash-escaped quote
I maintainer di solito rispondono entro 1 giorno
@7ttp ci sta già lavorando.
Dal 29/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2.4k
- Fork
- 526
- Merge medio
- 1g 2h
- PR unite (30g)
- 307
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di supabase/cli
-
Migration error caret is missing or misplaced when the statement contains multibyte charactersAperta🐛 Bug supabase/cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
🐛 Bug supabase/cli
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
db push applies migrations when the confirmation answer is not yes or noForse già presa @7ttp l’ha presa 2 giorni fa. Aperta🐛 Bug supabase/cli
supabase/cli#6869 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
🐛 Bug supabase/cli
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
🐛 Bug supabase/cli
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di supabase/cli
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
lichess-org/api#678 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
PostHog/posthog.com#20628 ·
I maintainer di solito rispondono entro 1 giorno
-
bug status:Needs Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
jupyterlab/jupyterlab#19964 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agentscope-ai/QwenPaw#8064 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: notebooks-jupyter bug theme: new notebook frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
posit-dev/positron#16347 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno