launchbadge/sqlx

Log queries including bind arguments and execution time

オープン

#162 opened on 2020/03/26

 (9 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (1,307 件のフォーク)batch import
enhancementhelp wanted

Repository metrics

Stars
 (13,916 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド