pub struct TableDef {
    pub name: String,
    pub foreign_keys: Vec<ForeignKeysInfo>,
    pub columns: Vec<ColumnInfo>,
    pub auto_increment: bool,
}
Available on crate features sqlite and def only.
Expand description

Defines a table for SQLite

Fields

name: String

The table name

foreign_keys: Vec<ForeignKeysInfo>

A list of foreign keys in the table

columns: Vec<ColumnInfo>

A list of all the columns and their types

auto_increment: bool

Whether the primary key should autoincrement

Implementations

Check if the primary key in the table is set to autoincrement as a result of using query `SELECT COUNT(*) from sqlite_sequence where name = ‘table_name’;

Get a list of all the indexes in the table. Note that this does not get the column name mapped by the index. To get the column name mapped by the index, the self.get_single_indexinfo method is invoked

Get a list of all the foreign keys in the table

Get a list of all the columns in the table mapped as ColumnInfo

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.