pub struct SpannerTableBuilder { /* private fields */ }Expand description
Builder for CREATE TABLE statements in Spanner DDL format
Implementations§
Source§impl SpannerTableBuilder
impl SpannerTableBuilder
Sourcepub fn col<S: Into<String>>(
self,
name: S,
col_type: &ColumnType,
not_null: bool,
) -> Self
pub fn col<S: Into<String>>( self, name: S, col_type: &ColumnType, not_null: bool, ) -> Self
Add a column with a SeaQuery ColumnType
Sourcepub fn col_raw<S: Into<String>, T: Into<String>>(
self,
name: S,
spanner_type: T,
not_null: bool,
) -> Self
pub fn col_raw<S: Into<String>, T: Into<String>>( self, name: S, spanner_type: T, not_null: bool, ) -> Self
Add a column with a raw Spanner type string
Sourcepub fn string<S: Into<String>>(
self,
name: S,
max_len: Option<u32>,
not_null: bool,
) -> Self
pub fn string<S: Into<String>>( self, name: S, max_len: Option<u32>, not_null: bool, ) -> Self
Add a STRING column
Sourcepub fn bytes<S: Into<String>>(
self,
name: S,
max_len: Option<u32>,
not_null: bool,
) -> Self
pub fn bytes<S: Into<String>>( self, name: S, max_len: Option<u32>, not_null: bool, ) -> Self
Add a BYTES column
Sourcepub fn timestamp<S: Into<String>>(self, name: S, not_null: bool) -> Self
pub fn timestamp<S: Into<String>>(self, name: S, not_null: bool) -> Self
Add a TIMESTAMP column
Sourcepub fn col_with_default<S: Into<String>, T: Into<String>, D: Into<String>>(
self,
name: S,
spanner_type: T,
not_null: bool,
default_expr: D,
) -> Self
pub fn col_with_default<S: Into<String>, T: Into<String>, D: Into<String>>( self, name: S, spanner_type: T, not_null: bool, default_expr: D, ) -> Self
Add a column with DEFAULT expression
Sourcepub fn col_generated<S: Into<String>, T: Into<String>, E: Into<String>>(
self,
name: S,
spanner_type: T,
expr: E,
stored: bool,
) -> Self
pub fn col_generated<S: Into<String>, T: Into<String>, E: Into<String>>( self, name: S, spanner_type: T, expr: E, stored: bool, ) -> Self
Add a generated column
Sourcepub fn primary_key<I, S>(self, columns: I) -> Self
pub fn primary_key<I, S>(self, columns: I) -> Self
Set primary key columns
Sourcepub fn interleave_in_parent<S: Into<String>>(self, parent_table: S) -> Self
pub fn interleave_in_parent<S: Into<String>>(self, parent_table: S) -> Self
Set INTERLEAVE IN PARENT clause
Sourcepub fn on_delete_cascade(self) -> Self
pub fn on_delete_cascade(self) -> Self
Set ON DELETE CASCADE for interleaved table
Sourcepub fn row_deletion_policy<S: Into<String>>(self, column: S, days: u32) -> Self
pub fn row_deletion_policy<S: Into<String>>(self, column: S, days: u32) -> Self
Set row deletion policy (TTL)
Trait Implementations§
Source§impl Clone for SpannerTableBuilder
impl Clone for SpannerTableBuilder
Source§fn clone(&self) -> SpannerTableBuilder
fn clone(&self) -> SpannerTableBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpannerTableBuilder
impl Debug for SpannerTableBuilder
Source§impl Default for SpannerTableBuilder
impl Default for SpannerTableBuilder
Source§fn default() -> SpannerTableBuilder
fn default() -> SpannerTableBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpannerTableBuilder
impl RefUnwindSafe for SpannerTableBuilder
impl Send for SpannerTableBuilder
impl Sync for SpannerTableBuilder
impl Unpin for SpannerTableBuilder
impl UnsafeUnpin for SpannerTableBuilder
impl UnwindSafe for SpannerTableBuilder
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