pub struct JsonIndex {
pub name: String,
pub table: String,
pub column: String,
pub path: Option<String>,
pub gin: bool,
}Expand description
JSON index definition.
Fields§
§name: StringIndex name.
table: StringTable name.
column: StringJSON column name.
path: Option<String>JSON path to index.
gin: boolWhether this is a GIN index (PostgreSQL).
Implementations§
Source§impl JsonIndex
impl JsonIndex
Sourcepub fn builder(name: impl Into<String>) -> JsonIndexBuilder
pub fn builder(name: impl Into<String>) -> JsonIndexBuilder
Create a new JSON index builder.
Sourcepub fn to_postgres_sql(&self) -> String
pub fn to_postgres_sql(&self) -> String
Generate PostgreSQL CREATE INDEX SQL.
Sourcepub fn to_mysql_sql(&self) -> Vec<String>
pub fn to_mysql_sql(&self) -> Vec<String>
Generate MySQL generated column + index SQL.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JsonIndex
impl<'de> Deserialize<'de> for JsonIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for JsonIndex
impl StructuralPartialEq for JsonIndex
Auto Trait Implementations§
impl Freeze for JsonIndex
impl RefUnwindSafe for JsonIndex
impl Send for JsonIndex
impl Sync for JsonIndex
impl Unpin for JsonIndex
impl UnwindSafe for JsonIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more