pub struct RepairTableStatement { /* private fields */ }Expand description
REPAIR TABLE statement builder
This struct provides a fluent API for constructing REPAIR TABLE queries. REPAIR TABLE repairs a possibly corrupted table.
MySQL-only: Other backends will panic with a helpful error message.
§Examples
use reinhardt_query::prelude::*;
// REPAIR TABLE users
let query = Query::repair_table()
.table("users");
// REPAIR TABLE users QUICK
let query = Query::repair_table()
.table("users")
.quick();
// REPAIR TABLE users EXTENDED USE_FRM
let query = Query::repair_table()
.table("users")
.extended()
.use_frm();Implementations§
Source§impl RepairTableStatement
impl RepairTableStatement
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new REPAIR TABLE statement
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table();Sourcepub fn take(&mut self) -> Self
pub fn take(&mut self) -> Self
Take the ownership of data in the current RepairTableStatement
Sourcepub fn table<T>(&mut self, table: T) -> &mut Selfwhere
T: IntoIden,
pub fn table<T>(&mut self, table: T) -> &mut Selfwhere
T: IntoIden,
Add a table to repair
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table()
.table("users");Sourcepub fn no_write_to_binlog(&mut self) -> &mut Self
pub fn no_write_to_binlog(&mut self) -> &mut Self
Set NO_WRITE_TO_BINLOG option
Suppresses binary logging for this operation.
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table()
.table("users")
.no_write_to_binlog();Sourcepub fn local(&mut self) -> &mut Self
pub fn local(&mut self) -> &mut Self
Set LOCAL option
Suppresses binary logging for this operation (same as NO_WRITE_TO_BINLOG).
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table()
.table("users")
.local();Sourcepub fn quick(&mut self) -> &mut Self
pub fn quick(&mut self) -> &mut Self
Set QUICK option
Tries to repair only the index file, not the data file.
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table()
.table("users")
.quick();Sourcepub fn extended(&mut self) -> &mut Self
pub fn extended(&mut self) -> &mut Self
Set EXTENDED option
Creates the index row by row instead of creating one index at a time with sorting.
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table()
.table("users")
.extended();Sourcepub fn use_frm(&mut self) -> &mut Self
pub fn use_frm(&mut self) -> &mut Self
Set USE_FRM option
Uses the table definition from the .frm file to recreate the index file.
§Examples
use reinhardt_query::prelude::*;
let query = Query::repair_table()
.table("users")
.use_frm();Sourcepub fn options(&mut self, opt: RepairTableOption) -> &mut Self
pub fn options(&mut self, opt: RepairTableOption) -> &mut Self
Set options from RepairTableOption
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::RepairTableOption;
let opt = RepairTableOption::new().quick(true).use_frm(true);
let query = Query::repair_table()
.table("users")
.options(opt);Trait Implementations§
Source§impl Clone for RepairTableStatement
impl Clone for RepairTableStatement
Source§fn clone(&self) -> RepairTableStatement
fn clone(&self) -> RepairTableStatement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more