pub struct TableSample {
pub method: SampleMethod,
pub size: SampleSize,
pub seed: Option<i64>,
}Expand description
Table sampling configuration.
Fields§
§method: SampleMethodSampling method.
size: SampleSizeSample size (percentage or rows).
seed: Option<i64>Optional seed for reproducibility.
Implementations§
Source§impl TableSample
impl TableSample
Sourcepub fn percent(percent: f64) -> TableSampleBuilder
pub fn percent(percent: f64) -> TableSampleBuilder
Create a percentage sample using BERNOULLI.
Sourcepub fn rows(count: usize) -> TableSampleBuilder
pub fn rows(count: usize) -> TableSampleBuilder
Create a row count sample.
Sourcepub fn to_postgres_sql(&self) -> String
pub fn to_postgres_sql(&self) -> String
Generate PostgreSQL TABLESAMPLE clause.
Sourcepub fn to_mssql_sql(&self) -> String
pub fn to_mssql_sql(&self) -> String
Generate MSSQL TABLESAMPLE clause.
Sourcepub fn to_sql(&self, db_type: DatabaseType) -> QueryResult<String>
pub fn to_sql(&self, db_type: DatabaseType) -> QueryResult<String>
Generate SQL for database type.
Trait Implementations§
Source§impl Clone for TableSample
impl Clone for TableSample
Source§fn clone(&self) -> TableSample
fn clone(&self) -> TableSample
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 TableSample
impl Debug for TableSample
Source§impl<'de> Deserialize<'de> for TableSample
impl<'de> Deserialize<'de> for TableSample
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TableSample
impl PartialEq for TableSample
Source§impl Serialize for TableSample
impl Serialize for TableSample
impl StructuralPartialEq for TableSample
Auto Trait Implementations§
impl Freeze for TableSample
impl RefUnwindSafe for TableSample
impl Send for TableSample
impl Sync for TableSample
impl Unpin for TableSample
impl UnwindSafe for TableSample
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