pub struct ShardConfig {
pub key: String,
}Expand description
Primary-key range sharding settings for the MSSQL source.
The source is split by contiguous ranges of an integer-typed column:
each shard runs SELECT * FROM (<query>) WHERE [key] >= lo AND [key] < hi.
The column must be present in the query’s output and orderable as a 64-bit
integer (e.g. a BIGINT/INT IDENTITY primary key).
ORDER BY: T-SQL forbids ORDER BY inside a derived table (without
TOP/OFFSET), so a sharded query must not end in a top-level ORDER BY
— ordering across concurrently-executing shards is meaningless anyway.
Nullable keys: if the key column contains NULLs, those rows are not
visible to the MIN/MAX range enumeration. They are still read — exactly
one shard (the last) additionally matches [key] IS NULL, so NULL-key rows
are covered by precisely one shard with no loss and no duplication.
Fields§
§key: StringInteger column to range-partition on. Quoted as an identifier (brackets) before use, so it is safe against injection but must name a real output column.
Trait Implementations§
Source§impl Clone for ShardConfig
impl Clone for ShardConfig
Source§fn clone(&self) -> ShardConfig
fn clone(&self) -> ShardConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShardConfig
impl Debug for ShardConfig
Source§impl<'de> Deserialize<'de> for ShardConfig
impl<'de> Deserialize<'de> for ShardConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ShardConfig
Source§impl JsonSchema for ShardConfig
impl JsonSchema for ShardConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ShardConfig
impl PartialEq for ShardConfig
Source§impl Serialize for ShardConfig
impl Serialize for ShardConfig
impl StructuralPartialEq for ShardConfig
Auto Trait Implementations§
impl Freeze for ShardConfig
impl RefUnwindSafe for ShardConfig
impl Send for ShardConfig
impl Sync for ShardConfig
impl Unpin for ShardConfig
impl UnsafeUnpin for ShardConfig
impl UnwindSafe for ShardConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.