mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
feat: add a name method to TypeInfo
This commit is contained in:
parent
e3adb88ab5
commit
11e21e201c
@ -1,3 +1,13 @@
|
||||
use std::fmt::{Debug, Display};
|
||||
|
||||
pub trait TypeInfo: Debug + Display + Clone + PartialEq<Self> {}
|
||||
/// Provides information about a SQL type for the database driver.
|
||||
///
|
||||
/// Currently this only exposes type equality rules that should roughly match the interpretation
|
||||
/// in a given database (e.g., in PostgreSQL `VARCHAR` and `TEXT` are roughly equivalent
|
||||
/// apart from storage).
|
||||
pub trait TypeInfo: Debug + Display + Clone + PartialEq<Self> {
|
||||
/// Returns the database system name of the type. Length specifiers should not be included.
|
||||
/// Common type names are `VARCHAR`, `TEXT`, or `INT`. Type names should be uppercase. They
|
||||
/// should be a rough approximation of how they are written in SQL in the given database.
|
||||
fn name(&self) -> &str;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user