launchbadge / sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
Apache License 2.0
13.5k stars 1.28k forks source link

Is is possible to return column info if no data returned?? #3552

Closed yuyang-ok closed 4 weeks ago

yuyang-ok commented 1 month ago

I have an empty table contains no data.

image

when use this library is it possible to return column info if no data need return. by the way I am using postgres. is postgres's protocol still return column info if no data exists. image

abonander commented 4 weeks ago

You can call Executor::prepare_with() which returns a PgStatement with all this information.