pub struct Fts5Table { /* private fields */ }Expand description
Assembles CREATE VIRTUAL TABLE … USING fts5(…) without hand-writing the
module arguments.
use toolu_orm_core::column::ColumnType;
use toolu_orm_core::fts5::Fts5Table;
let table = Fts5Table::new("memory_fts")
.unindexed_column("memory_id", ColumnType::Text)
.column("body", ColumnType::Text)
.tokenize("porter unicode61")
.build();
assert_eq!(table.kind.module(), Some("fts5"));
assert_eq!(table.kind.args()[0], "\"memory_id\" UNINDEXED");Implementations§
Source§impl Fts5Table
impl Fts5Table
pub fn new(name: impl Into<String>) -> Self
Sourcepub fn column(self, name: impl Into<String>, column_type: ColumnType) -> Self
pub fn column(self, name: impl Into<String>, column_type: ColumnType) -> Self
A searchable column. FTS5 stores every column as text; column_type is
kept as metadata for the generated typed columns and is never rendered
into the DDL.
Sourcepub fn unindexed_column(
self,
name: impl Into<String>,
column_type: ColumnType,
) -> Self
pub fn unindexed_column( self, name: impl Into<String>, column_type: ColumnType, ) -> Self
A column stored but not indexed (UNINDEXED), so it is returned by
queries but never matched by MATCH.
Sourcepub fn tokenize(self, spec: impl Into<String>) -> Self
pub fn tokenize(self, spec: impl Into<String>) -> Self
The tokenizer chain, e.g. porter unicode61 remove_diacritics 2.
Sourcepub fn content(self, table: impl Into<String>) -> Self
pub fn content(self, table: impl Into<String>) -> Self
External content table; the empty string makes the table contentless.
Sourcepub fn content_rowid(self, column: impl Into<String>) -> Self
pub fn content_rowid(self, column: impl Into<String>) -> Self
The rowid column of the external content table.
Sourcepub fn columnsize(self, value: u8) -> Self
pub fn columnsize(self, value: u8) -> Self
columnsize = 0 drops the per-column size index.
Sourcepub fn build(self) -> TableDef
pub fn build(self) -> TableDef
The finished definition, with the module arguments rendered into
TableKind::Virtual.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fts5Table
impl RefUnwindSafe for Fts5Table
impl Send for Fts5Table
impl Sync for Fts5Table
impl Unpin for Fts5Table
impl UnsafeUnpin for Fts5Table
impl UnwindSafe for Fts5Table
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