Skip to content

Commit 67f9826

Browse files
committed
Add non_exhasutive to more enum
- func::Function - types::{ColumnRef, TableRef, UnOper, BinOper, Keyword, SubQueryOper} - value::{Value, ValueTuple} - extension::mysql::column::MySqlType - extension::postgres::func::PgFunction - extension::postgres::PgBinOper - extension::postgres::select::SampleMethod - extension::postgres::types::TypeAs - extension::sqlite::SqliteBinOper
1 parent a59a7d2 commit 67f9826

File tree

9 files changed

+15
-0
lines changed

9 files changed

+15
-0
lines changed

src/extension/mysql/column.rs

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

33
#[derive(Debug, Copy, Clone)]
4+
#[non_exhaustive]
45
pub enum MySqlType {
56
TinyBlob,
67
MediumBlob,

src/extension/postgres/func.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::{expr::*, func::*, PgDateTruncUnit};
88
///
99
/// If something is not supported, you can use [`Function::Custom`].
1010
#[derive(Debug, Clone, PartialEq)]
11+
#[non_exhaustive]
1112
pub enum PgFunction {
1213
ToTsquery,
1314
ToTsvector,

src/extension/postgres/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub(crate) mod types;
1919
///
2020
/// For all supported operators (including the standard ones), see [`BinOper`].
2121
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
22+
#[non_exhaustive]
2223
pub enum PgBinOper {
2324
ILike,
2425
NotILike,

src/extension/postgres/select.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub struct TableSample {
88
}
99

1010
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11+
#[non_exhaustive]
1112
pub enum SampleMethod {
1213
BERNOULLI,
1314
SYSTEM,

src/extension/postgres/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub struct TypeCreateStatement {
5959
}
6060

6161
#[derive(Debug, Clone)]
62+
#[non_exhaustive]
6263
pub enum TypeAs {
6364
// Composite,
6465
Enum,

src/extension/sqlite/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mod expr;
88
///
99
/// For all supported operators (including the standard ones), see [`BinOper`].
1010
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11+
#[non_exhaustive]
1112
pub enum SqliteBinOper {
1213
/// `GLOB`
1314
Glob,

src/func.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub use crate::extension::postgres::{PgFunc, PgFunction};
99
///
1010
/// If something is not supported here, you can use [`Function::Custom`].
1111
#[derive(Debug, Clone, PartialEq)]
12+
#[non_exhaustive]
1213
pub enum Function {
1314
Max,
1415
Min,

src/types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ impl fmt::Debug for dyn Iden {
131131

132132
/// Column references
133133
#[derive(Debug, Clone, PartialEq)]
134+
#[non_exhaustive]
134135
pub enum ColumnRef {
135136
Column(DynIden),
136137
TableColumn(DynIden, DynIden),
@@ -146,6 +147,7 @@ pub trait IntoColumnRef {
146147
/// Table references
147148
#[allow(clippy::large_enum_variant)]
148149
#[derive(Debug, Clone, PartialEq)]
150+
#[non_exhaustive]
149151
pub enum TableRef {
150152
/// Table identifier without any schema / database prefix
151153
Table(DynIden),
@@ -173,6 +175,7 @@ pub trait IntoTableRef {
173175

174176
/// Unary operators.
175177
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
178+
#[non_exhaustive]
176179
pub enum UnOper {
177180
Not,
178181
}
@@ -181,6 +184,7 @@ pub enum UnOper {
181184
///
182185
/// If something is not supported here, you can use [`BinOper::Custom`].
183186
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
187+
#[non_exhaustive]
184188
pub enum BinOper {
185189
And,
186190
Or,
@@ -334,6 +338,7 @@ pub struct Asterisk;
334338
///
335339
/// If something is not supported here, you can use [`Keyword::Custom`].
336340
#[derive(Debug, Clone, PartialEq)]
341+
#[non_exhaustive]
337342
pub enum Keyword {
338343
Null,
339344
CurrentDate,
@@ -355,6 +360,7 @@ pub trait IntoLikeExpr {
355360

356361
/// SubQuery operators
357362
#[derive(Debug, Copy, Clone, PartialEq)]
363+
#[non_exhaustive]
358364
pub enum SubQueryOper {
359365
Exists,
360366
Any,

src/value.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ pub enum ArrayType {
124124
/// implementation of NaN != NaN.
125125
#[derive(Clone, Debug)]
126126
#[cfg_attr(not(feature = "hashable-value"), derive(PartialEq))]
127+
#[non_exhaustive]
127128
pub enum Value {
128129
Bool(Option<bool>),
129130
TinyInt(Option<i8>),
@@ -259,6 +260,7 @@ pub struct Values(pub Vec<Value>);
259260

260261
#[derive(Clone, Debug, PartialEq)]
261262
#[cfg_attr(feature = "hashable-value", derive(Hash, Eq))]
263+
#[non_exhaustive]
262264
pub enum ValueTuple {
263265
One(Value),
264266
Two(Value, Value),

0 commit comments

Comments
 (0)