Skip to content

Commit b3b9aa3

Browse files
committed
Add non_exhasutive to more enum
1 parent 67f9826 commit b3b9aa3

File tree

19 files changed

+32
-0
lines changed

19 files changed

+32
-0
lines changed

src/backend/foreign_key_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::*;
22

33
#[derive(Debug, PartialEq, Eq)]
4+
#[non_exhaustive]
45
pub enum Mode {
56
Creation,
67
Alter,

src/extension/mysql/index.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ pub struct IndexHint {
1010
}
1111

1212
#[derive(Debug, Clone, Copy, PartialEq)]
13+
#[non_exhaustive]
1314
pub enum IndexHintType {
1415
Use,
1516
Ignore,
1617
Force,
1718
}
1819

1920
#[derive(Debug, Clone, Copy, PartialEq)]
21+
#[non_exhaustive]
2022
pub enum IndexHintScope {
2123
Join,
2224
OrderBy,

src/extension/postgres/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::{prepare::*, types::*, QueryBuilder, QuotedBuilder};
55
pub struct Type;
66

77
#[derive(Clone, Debug)]
8+
#[non_exhaustive]
89
pub enum TypeRef {
910
Type(DynIden),
1011
SchemaType(DynIden, DynIden),
@@ -82,12 +83,14 @@ pub struct TypeAlterStatement {
8283
}
8384

8485
#[derive(Debug, Clone)]
86+
#[non_exhaustive]
8587
pub enum TypeDropOpt {
8688
Cascade,
8789
Restrict,
8890
}
8991

9092
#[derive(Debug, Clone)]
93+
#[non_exhaustive]
9194
pub enum TypeAlterOpt {
9295
Add {
9396
value: DynIden,
@@ -99,6 +102,7 @@ pub enum TypeAlterOpt {
99102
}
100103

101104
#[derive(Debug, Clone)]
105+
#[non_exhaustive]
102106
pub enum TypeAlterAddOpt {
103107
Before(DynIden),
104108
After(DynIden),

src/foreign_key/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub struct TableForeignKey {
1414

1515
/// Foreign key on update & on delete actions
1616
#[derive(Debug, Clone, Copy)]
17+
#[non_exhaustive]
1718
pub enum ForeignKeyAction {
1819
Restrict,
1920
Cascade,

src/foreign_key/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub struct ForeignKey;
1919

2020
/// All available types of foreign key statement
2121
#[derive(Debug, Clone)]
22+
#[non_exhaustive]
2223
pub enum ForeignKeyStatement {
2324
Create(ForeignKeyCreateStatement),
2425
Drop(ForeignKeyDropStatement),

src/index/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub struct TableIndex {
99
}
1010

1111
#[derive(Debug, Clone)]
12+
#[non_exhaustive]
1213
pub enum IndexColumn {
1314
TableColumn(IndexColumnTableColumn),
1415
Expr(IndexColumnExpr),
@@ -37,6 +38,7 @@ impl IndexColumn {
3738
}
3839

3940
#[derive(Debug, Clone)]
41+
#[non_exhaustive]
4042
pub enum IndexOrder {
4143
Asc,
4244
Desc,

src/index/create.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ pub struct IndexCreateStatement {
222222

223223
/// Specification of a table index
224224
#[derive(Debug, Clone)]
225+
#[non_exhaustive]
225226
pub enum IndexType {
226227
BTree,
227228
FullText,

src/index/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub struct Index;
1919

2020
/// All available types of index statement
2121
#[derive(Debug, Clone)]
22+
#[non_exhaustive]
2223
pub enum IndexStatement {
2324
Create(IndexCreateStatement),
2425
Drop(IndexDropStatement),

src/query/select.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pub struct SelectStatement {
6363

6464
/// List of distinct keywords that can be used in select statement
6565
#[derive(Debug, Clone, PartialEq)]
66+
#[non_exhaustive]
6667
pub enum SelectDistinct {
6768
All,
6869
Distinct,
@@ -72,6 +73,7 @@ pub enum SelectDistinct {
7273

7374
/// Window type in [`SelectExpr`]
7475
#[derive(Debug, Clone, PartialEq)]
76+
#[non_exhaustive]
7577
pub enum WindowSelectType {
7678
/// Name in [`SelectStatement`]
7779
Name(DynIden),
@@ -98,6 +100,7 @@ pub struct JoinExpr {
98100

99101
/// List of lock types that can be used in select statement
100102
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
103+
#[non_exhaustive]
101104
pub enum LockType {
102105
/// Exclusive lock
103106
Update,
@@ -109,6 +112,7 @@ pub enum LockType {
109112

110113
/// List of lock behavior can be used in select statement
111114
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
115+
#[non_exhaustive]
112116
pub enum LockBehavior {
113117
Nowait,
114118
SkipLocked,
@@ -123,6 +127,7 @@ pub struct LockClause {
123127

124128
/// List of union types that can be used in union clause
125129
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
130+
#[non_exhaustive]
126131
pub enum UnionType {
127132
Intersect,
128133
Distinct,

src/query/with.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ impl CommonTableExpression {
187187
/// For recursive [WithQuery] [WithClause]s the traversing order can be specified in some databases
188188
/// that support this functionality.
189189
#[derive(Debug, Clone, PartialEq)]
190+
#[non_exhaustive]
190191
pub enum SearchOrder {
191192
/// Breadth first traversal during the execution of the recursive query.
192193
BREADTH,

0 commit comments

Comments
 (0)