Remove "sql" prefix from module names

Since this crate only deals with SQL parsing, the modules are understood
to refer to SQL and don't need to restate that explicitly.
This commit is contained in:
Nikhil Benesch 2019-06-24 12:56:26 -04:00
parent 5b23ad1d4c
commit cf655ad1a6
No known key found for this signature in database
GPG key ID: FCF98542083C5A69
18 changed files with 24 additions and 24 deletions

View file

@ -19,7 +19,7 @@ use simple_logger;
use std::fs; use std::fs;
use sqlparser::dialect::*; use sqlparser::dialect::*;
use sqlparser::sqlparser::Parser; use sqlparser::parser::Parser;
fn main() { fn main() {
simple_logger::init().unwrap(); simple_logger::init().unwrap();

View file

@ -13,7 +13,7 @@
#![warn(clippy::all)] #![warn(clippy::all)]
use sqlparser::dialect::GenericSqlDialect; use sqlparser::dialect::GenericSqlDialect;
use sqlparser::sqlparser::*; use sqlparser::parser::*;
fn main() { fn main() {
let sql = "SELECT a, b, 123, myfunc(b) \ let sql = "SELECT a, b, 123, myfunc(b) \

View file

@ -12,23 +12,23 @@
//! SQL Abstract Syntax Tree (AST) types //! SQL Abstract Syntax Tree (AST) types
mod data_type;
mod ddl; mod ddl;
mod operator;
mod query; mod query;
mod sql_operator;
mod sqltype;
mod value; mod value;
use std::ops::Deref; use std::ops::Deref;
pub use self::data_type::SQLType;
pub use self::ddl::{ pub use self::ddl::{
AlterTableOperation, ColumnOption, ColumnOptionDef, SQLColumnDef, TableConstraint, AlterTableOperation, ColumnOption, ColumnOptionDef, SQLColumnDef, TableConstraint,
}; };
pub use self::operator::{SQLBinaryOperator, SQLUnaryOperator};
pub use self::query::{ pub use self::query::{
Cte, Fetch, Join, JoinConstraint, JoinOperator, SQLOrderByExpr, SQLQuery, SQLSelect, Cte, Fetch, Join, JoinConstraint, JoinOperator, SQLOrderByExpr, SQLQuery, SQLSelect,
SQLSelectItem, SQLSetExpr, SQLSetOperator, SQLValues, TableAlias, TableFactor, TableWithJoins, SQLSelectItem, SQLSetExpr, SQLSetOperator, SQLValues, TableAlias, TableFactor, TableWithJoins,
}; };
pub use self::sql_operator::{SQLBinaryOperator, SQLUnaryOperator};
pub use self::sqltype::SQLType;
pub use self::value::{SQLDateTimeField, Value}; pub use self::value::{SQLDateTimeField, Value};
/// Like `vec.join(", ")`, but for any types implementing ToString. /// Like `vec.join(", ")`, but for any types implementing ToString.
@ -662,7 +662,7 @@ impl ToString for FileFormat {
} }
} }
use crate::sqlparser::ParserError; use crate::parser::ParserError;
use std::str::FromStr; use std::str::FromStr;
impl FromStr for FileFormat { impl FromStr for FileFormat {
type Err = ParserError; type Err = ParserError;

View file

@ -10,16 +10,16 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
mod ansi_sql; mod ansi;
mod generic_sql; mod generic;
pub mod keywords; pub mod keywords;
mod mssql; mod mssql;
mod postgresql; mod postgresql;
use std::fmt::Debug; use std::fmt::Debug;
pub use self::ansi_sql::AnsiSqlDialect; pub use self::ansi::AnsiSqlDialect;
pub use self::generic_sql::GenericSqlDialect; pub use self::generic::GenericSqlDialect;
pub use self::mssql::MsSqlDialect; pub use self::mssql::MsSqlDialect;
pub use self::postgresql::PostgreSqlDialect; pub use self::postgresql::PostgreSqlDialect;

View file

@ -19,7 +19,7 @@
//! //!
//! ``` //! ```
//! use sqlparser::dialect::GenericSqlDialect; //! use sqlparser::dialect::GenericSqlDialect;
//! use sqlparser::sqlparser::Parser; //! use sqlparser::parser::Parser;
//! //!
//! let dialect = GenericSqlDialect {}; // or AnsiSqlDialect //! let dialect = GenericSqlDialect {}; // or AnsiSqlDialect
//! //!
@ -34,10 +34,10 @@
//! ``` //! ```
#![warn(clippy::all)] #![warn(clippy::all)]
pub mod ast;
pub mod dialect; pub mod dialect;
pub mod sqlast; pub mod parser;
pub mod sqlparser; pub mod tokenizer;
pub mod sqltokenizer;
#[doc(hidden)] #[doc(hidden)]
// This is required to make utilities accessible by both the crate-internal // This is required to make utilities accessible by both the crate-internal

View file

@ -14,10 +14,10 @@
use log::debug; use log::debug;
use super::ast::*;
use super::dialect::keywords; use super::dialect::keywords;
use super::dialect::Dialect; use super::dialect::Dialect;
use super::sqlast::*; use super::tokenizer::*;
use super::sqltokenizer::*;
use std::error::Error; use std::error::Error;
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]

View file

@ -12,10 +12,10 @@
use std::fmt::Debug; use std::fmt::Debug;
use super::ast::*;
use super::dialect::*; use super::dialect::*;
use super::sqlast::*; use super::parser::{Parser, ParserError};
use super::sqlparser::{Parser, ParserError}; use super::tokenizer::Tokenizer;
use super::sqltokenizer::Tokenizer;
/// Tests use the methods on this struct to invoke the parser on one or /// Tests use the methods on this struct to invoke the parser on one or
/// multiple dialects. /// multiple dialects.

View file

@ -20,8 +20,8 @@
use matches::assert_matches; use matches::assert_matches;
use sqlparser::sqlast::*; use sqlparser::ast::*;
use sqlparser::sqlparser::*; use sqlparser::parser::*;
use sqlparser::test_utils::{all_dialects, expr_from_projection, only}; use sqlparser::test_utils::{all_dialects, expr_from_projection, only};
#[test] #[test]

View file

@ -14,8 +14,8 @@
//! Test SQL syntax specific to Microsoft's T-SQL. The parser based on the //! Test SQL syntax specific to Microsoft's T-SQL. The parser based on the
//! generic dialect is also tested (on the inputs it can handle). //! generic dialect is also tested (on the inputs it can handle).
use sqlparser::ast::*;
use sqlparser::dialect::{GenericSqlDialect, MsSqlDialect}; use sqlparser::dialect::{GenericSqlDialect, MsSqlDialect};
use sqlparser::sqlast::*;
use sqlparser::test_utils::*; use sqlparser::test_utils::*;
#[test] #[test]

View file

@ -14,8 +14,8 @@
//! Test SQL syntax specific to PostgreSQL. The parser based on the //! Test SQL syntax specific to PostgreSQL. The parser based on the
//! generic dialect is also tested (on the inputs it can handle). //! generic dialect is also tested (on the inputs it can handle).
use sqlparser::ast::*;
use sqlparser::dialect::{GenericSqlDialect, PostgreSqlDialect}; use sqlparser::dialect::{GenericSqlDialect, PostgreSqlDialect};
use sqlparser::sqlast::*;
use sqlparser::test_utils::*; use sqlparser::test_utils::*;
#[test] #[test]