pub struct TableDefinitionBuilder { /* private fields */ }Expand description
Builder for creating TableDefinition instances with a fluent API.
Implementations§
Source§impl TableDefinitionBuilder
impl TableDefinitionBuilder
Sourcepub fn table_name(self, table_name: &str) -> Self
pub fn table_name(self, table_name: &str) -> Self
Set the physical table name.
Sourcepub const fn storage(self, storage: BackendType) -> Self
pub const fn storage(self, storage: BackendType) -> Self
Set the storage backend type.
Sourcepub fn field(self, name: &str, field_type: &str, is_primary: bool) -> Self
pub fn field(self, name: &str, field_type: &str, is_primary: bool) -> Self
Add a field to the table.
Sourcepub fn indexed_field(self, name: &str, field_type: &str) -> Self
pub fn indexed_field(self, name: &str, field_type: &str) -> Self
Add a field with a standard secondary index.
Sourcepub fn vector_field(self, name: &str, hnsw_config: HnswConfig) -> Self
pub fn vector_field(self, name: &str, hnsw_config: HnswConfig) -> Self
Add a field with a vector (HNSW) index.
Sourcepub fn custom_path(self, path: &str) -> Self
pub fn custom_path(self, path: &str) -> Self
Set custom endpoint path.
Sourcepub const fn rest_enabled(self, enabled: bool) -> Self
pub const fn rest_enabled(self, enabled: bool) -> Self
Enable/disable REST interface.
Sourcepub const fn graphql_enabled(self, enabled: bool) -> Self
pub const fn graphql_enabled(self, enabled: bool) -> Self
Enable/disable GraphQL interface.
Sourcepub const fn ws_enabled(self, enabled: bool) -> Self
pub const fn ws_enabled(self, enabled: bool) -> Self
Enable/disable WebSocket interface.
Sourcepub const fn sse_enabled(self, enabled: bool) -> Self
pub const fn sse_enabled(self, enabled: bool) -> Self
Enable/disable SSE interface.
Sourcepub const fn mcp_enabled(self, enabled: bool) -> Self
pub const fn mcp_enabled(self, enabled: bool) -> Self
Enable/disable MCP interface.
Sourcepub const fn expiration(self, seconds: u64) -> Self
pub const fn expiration(self, seconds: u64) -> Self
Set cache expiration in seconds.
Sourcepub fn consistency(self, mode: ConsistencyMode) -> Self
pub fn consistency(self, mode: ConsistencyMode) -> Self
Set consistency mode via distribute config.
Sourcepub fn fulltext_field(self, name: &str, field_type: &str) -> Self
pub fn fulltext_field(self, name: &str, field_type: &str) -> Self
Add a field with a full-text search index.
Sourcepub fn composite_index(self, fields: &[&str]) -> Self
pub fn composite_index(self, fields: &[&str]) -> Self
Add a composite index on multiple fields.
Sourcepub fn build(self) -> TableDefinition
pub fn build(self) -> TableDefinition
Build the TableDefinition.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableDefinitionBuilder
impl RefUnwindSafe for TableDefinitionBuilder
impl Send for TableDefinitionBuilder
impl Sync for TableDefinitionBuilder
impl Unpin for TableDefinitionBuilder
impl UnsafeUnpin for TableDefinitionBuilder
impl UnwindSafe for TableDefinitionBuilder
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