Trait CreateTable

Source
pub trait CreateTable<'until_build, 'post_build> {
    // Required methods
    fn add_column(
        self,
        column: CreateColumnImpl<'until_build, 'post_build>,
    ) -> Self;
    fn if_not_exists(self) -> Self;
    fn build(self) -> Result<Vec<(String, Vec<Value<'post_build>>)>, Error>;
}
Expand description

The trait representing a create table builder

Required Methods§

Source

fn add_column(self, column: CreateColumnImpl<'until_build, 'post_build>) -> Self

Add a column to the table.

Source

fn if_not_exists(self) -> Self

Sets the IF NOT EXISTS trait on the table

Source

fn build(self) -> Result<Vec<(String, Vec<Value<'post_build>>)>, Error>

This method is used to convert the current state for the given dialect in a list of tuples.

Each tuple consists of the query string and the corresponding bind parameters.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'until_build, 'post_build> CreateTable<'until_build, 'post_build> for CreateTableImpl<'until_build, 'post_build>