Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Place a query fingerprint in a comment at the start of each query

Aperta
#4,099 1 commento 1 reazione 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
32/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
mysql, postgresql, rust, sql, sqlite

Direzione di ricerca

The request is to have sqlx prefix every query with a comment containing a hash of the query string so tools like RDS can identify it, and so .sqlx/query-*.json can be searched for that hash. Start from how compile-time query macros and the query cache emit SQL, then decide where a fingerprint comment can be injected without breaking existing stored query documents. Done means generated SQL starts with that comment and the json artifacts update accordingly; this is a breaking change for those files.

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

Descrizione

enhancement
I have found these related issues/pull requests

I don't see any related issues or pull requests.

Description

I'm finding that various DB performance tools don't show me the whole query. In particular, this is true for RDS. This makes it hard to identify which query is slow. To help this, we've manually injected a uuid in a comment on all queries:

sqlx::query_scalar!(
                r#"
                -- 935300b8-3def-431f-8480-8ae8e034fb0a
                SELECT
                    customer.name
...

This seems fine in the sense that it solves the problem, but the diff to apply it was hefty and tedious (+4,261 -3,752).

Prefered solution

Instead, I'd love for sqlx to automatically inject an identifying hash (for example, the hash of the query string) as a comment prefix. This would let us search .sqlx/query-*.json for the matching hash and conclusively identify the query.

Is this a breaking change? Why or why not?

It will cause all the pregenerated / stored .json query documents to change.

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

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.