Skip to content

Commit 0b0d9f9

Browse files
committed
Add sqlite variant
1 parent 1e7607c commit 0b0d9f9

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sql-parse"
3-
version = "0.22.1"
3+
version = "0.23.0"
44
edition = "2021"
55
authors = ["Jakob Truelsen <[email protected]>"]
66
keywords = [ "mysql", "postgresql", "sql", "lexer", "parser" ]

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ pub use sstring::SString;
7676
pub use statement::{Statement, Union, UnionType, UnionWith};
7777

7878
pub use alter::{
79-
AlterSpecification, AlterTable, ForeignKeyOn, ForeignKeyOnAction, ForeignKeyOnType, IndexCol, AlterColumnAction,
80-
IndexOption, IndexType,
79+
AlterColumnAction, AlterSpecification, AlterTable, ForeignKeyOn, ForeignKeyOnAction,
80+
ForeignKeyOnType, IndexCol, IndexOption, IndexType,
8181
};
8282
pub use create::{
8383
CreateAlgorithm, CreateDefinition, CreateFunction, CreateOption, CreateTable, CreateTrigger,
@@ -110,6 +110,7 @@ pub enum SQLDialect {
110110
/// Parse MariaDB/Mysql SQL
111111
MariaDB,
112112
PostgreSQL,
113+
Sqlite,
113114
}
114115

115116
impl SQLDialect {
@@ -120,6 +121,10 @@ impl SQLDialect {
120121
pub fn is_maria(&self) -> bool {
121122
matches!(self, SQLDialect::MariaDB)
122123
}
124+
125+
pub fn is_sqlite(&self) -> bool {
126+
matches!(self, SQLDialect::Sqlite)
127+
}
123128
}
124129

125130
/// What kinds or arguments

0 commit comments

Comments
 (0)