compile-time macro support for amazon aurora dsql

Aperta
#4,162 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
aws, postgresql, rust
Ambito
backend, databases

Direzione di ricerca

Start in sqlx-postgres/src/connection/describe.rs around the EXPLAIN/EXECUTE path (near L526) and the CockroachDB-style detection that skips EXPLAIN (L416–L422). Determine how Aurora DSQL can be identified and routed to the non-EXECUTE describe path so query_as! and cargo sqlx prepare work. Done when simple parameterized queries describe successfully against DSQL without the unsupported Execute error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
I have found these related issues/pull requests

maybe relates to https://github.com/launchbadge/sqlx/pull/3640 ?

Description

I'm using sqlx with amazon aurora dsql, which is a subset of postgres.

When trying to use the query_as! macro, as well as preparing for offline mode with cargo sqlx prepare, I encounter the error error returned from database: unsupported statement: Execute for even simple queries such as sqlx::query_as!(MyEntity, "SELECT * FROM mytable WHERE id=$1", id) .

After investigating for a few hours (and I'm new to sqlx so please lmk if I'm entirely off the mark), think I pinpointed the problem into the describe logic on sqlx-postgres , which uses EXPLAIN ... EXECUTE ... if EXPLAIN is supported by the db: dsql supports EXPLAIN but not with EXECUTE.

Prefered solution

I don't think I understand enough of what could be an appropriate way to add support in this case, but perhaps this could fall into a case similar to cockroachdb and others, which I see in the same file are detected as not supporting explain and use alternative logic?

would be great to be able to use compile-time checked queries in dsql too! 🙏 thank you

Is this a breaking change? Why or why not?

I wouldn't think so - but as per above, I don't have enough in-depth knowledge of sqlx to understand whether an appropriate solution needs more complex changes.

Lingua principale
Rust
Stelle
17.5k
Fork
1.7k
Merge medio
1g 17h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di transact-rs/sqlx

Tutte le issue di transact-rs/sqlx

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.