launchbadge/sqlx

Log queries including bind arguments and execution time

Open

#162 aperta il 26 mar 2020

Vedi su GitHub
 (9 commenti) (0 reazioni) (0 assegnatari)Rust (1307 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (13.916 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

TRACE sqlx::query > SELECT …, elapsed: 0.04ms

    SELECT foo, bar, baz
    FROM this_table_over_here
    WHERE foo = $1 AND bar = $2
    ORDER BY baz

    $1 = 50
    $2 = 694

TRACE sqlx::query > INSERT INTO table_name …, elapsed: 12.04ms

Log format is very "let's figure out what we think looks best". Use log. We should new line + indent like error stack traces for the query body. Not sure how to nicely show the bind arguments.

Guida contributor