#[non_exhaustive]pub enum LockTables {
MySql {
pluralized_table_keyword: bool,
tables: Vec<MySqlTableLock>,
},
Postgres {
tables: Vec<ObjectName>,
lock_mode: Option<LockTableType>,
has_table_keyword: bool,
only: bool,
no_wait: bool,
},
}Expand description
A LOCK TABLE .. statement. MySQL and Postgres variants are supported.
The MySQL and Postgres syntax variants are significant enough that they
are explicitly represented as enum variants. In order to support additional
databases in the future, this enum is marked as #[non_exhaustive].
In MySQL, when multiple tables are mentioned in the statement the lock mode can vary per table.
In contrast, Postgres only allows specifying a single mode which is applied to all mentioned tables.
MySQL: see https://dev.mysql.com/doc/refman/8.0/en/lock-tables.html
LOCK [TABLE | TABLES] name [[AS] alias] locktype [,name [[AS] alias] locktype]Where locktype is:
READ [LOCAL] | [LOW_PRIORITY] WRITEPostgres: See https://www.postgresql.org/docs/current/sql-lock.html
LOCK [ TABLE ] [ ONLY ] name [, ...] [ IN lockmode MODE ] [ NOWAIT ]Where lockmode is one of:
ACCESS SHARE | ROW SHARE | ROW EXCLUSIVE | SHARE UPDATE EXCLUSIVE
| SHARE | SHARE ROW EXCLUSIVE | EXCLUSIVE | ACCESS EXCLUSIVEVariants (Non-exhaustive)§
This enum is marked as non-exhaustive
MySql
The MySQL syntax variant
Fields
tables: Vec<MySqlTableLock>The tables to lock and their per-table lock mode.
Postgres
The Postgres syntax variant.
Fields
tables: Vec<ObjectName>One or more optionally schema-qualified table names to lock.
lock_mode: Option<LockTableType>The lock type applied to all mentioned tables.
Trait Implementations§
Source§impl Clone for LockTables
impl Clone for LockTables
Source§fn clone(&self) -> LockTables
fn clone(&self) -> LockTables
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more