mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-16 02:37:55 +00:00
implement nullability check for Postgres as a query on pg_attribute implement type name fetching for Postgres as part of `describe()` add nullability for describe() to MySQL improve errors with unknown result column type IDs in `query!()` run cargo fmt and fix warnings improve error when feature gates for chrono/uuid types is not turned on workflows/rust: add step to UI-test missing optional features improve error for unsupported/feature-gated input parameter types fix `PgConnection::get_type_names()` for empty type IDs list fix `tests::mysql::test_describe()` on MariaDB 10.4 copy-edit unsupported/feature-gated type errors in `query!()` Postgres: fix SQL type of string array closes #107 closes #17 Co-Authored-By: Anthony Dodd <Dodd.AnthonyJosiah@gmail.com>
18 lines
405 B
Rust
18 lines
405 B
Rust
use std::io::Write;
|
|
|
|
use crate::io::BufMut;
|
|
use crate::postgres::protocol::Encode;
|
|
|
|
#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Hash)]
|
|
pub struct StatementId(pub u32);
|
|
|
|
impl Encode for StatementId {
|
|
fn encode(&self, buf: &mut Vec<u8>) {
|
|
if self.0 != 0 {
|
|
let _ = write!(buf, "__sqlx_statement_{}\0", self.0);
|
|
} else {
|
|
buf.put_str_nul("");
|
|
}
|
|
}
|
|
}
|