Skip to content

What's the best way to merge my fork? #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d8173d4
Extract ASTNode::SQLSelect to a separate struct (1/5)
nickolay Jan 20, 2019
45a5f84
Move SQLOrderByExpr and Join* to query.rs (2/5)
nickolay Jan 20, 2019
7b86f5c
Remove unused ASTNode::SQLAssignment variant (3/5)
nickolay Jan 29, 2019
2dec65f
Separate statement from expr parsing (4/5)
nickolay Jan 31, 2019
5a0e0ec
Simplify some tests by introducing `verified_select_stmt` and `expr_f…
nickolay Feb 3, 2019
707c58a
Support parsing of multiple statements (5/5)
nickolay Jan 29, 2019
b57c60a
Only use parse_expr() when we expect an expression (0/4)
nickolay Jan 29, 2019
29db619
Stop losing parens when roundtripping (1/4)
nickolay Jan 30, 2019
82dc581
Fix precedence for the NOT operator (2/4)
nickolay Jan 30, 2019
215820e
Stricter parsing for subqueries (3/4)
nickolay Jan 30, 2019
523f086
Introduce SQLObjectName struct (4.1/4.4)
nickolay Jan 30, 2019
39e98cb
Rename parse_tablename -> parse_object_name (4.2/4.4)
nickolay Jan 30, 2019
f5bd9c3
Simplify by avoiding SQLCompoundIdentifier (4.3/4.4)
nickolay Jan 30, 2019
07790fe
Improve DELETE FROM parsing (4.4/4.4)
nickolay Jan 30, 2019
e0ceacd
Store original, quoted form in SQLIdent
nickolay Jan 30, 2019
9967031
Move TableFactor to be a separate enum
nickolay Feb 6, 2019
3619e89
Remove Box<> from SQLOrderByExpr
nickolay Jan 31, 2019
c5bbfc3
Don't Box<ASTNode> in SQLStatement
nickolay Jan 31, 2019
e3b981a
Don't Box<ASTNode> in SQLSelect
nickolay Jan 31, 2019
6b10706
Switch some tests to `verified_select_stmt`
nickolay Feb 6, 2019
05a70a3
Assert when an unknown keyword was passed to parse_keyword()
nickolay Feb 3, 2019
b716ffb
Simplify JOIN USING (columns)
nickolay Jan 30, 2019
89602dc
Fix a typo in parse_value error message
nickolay Jan 30, 2019
a0f625b
Simplify parse_create() a little
nickolay Jan 31, 2019
346d1ff
Improve error messages in parse_create()
nickolay Jan 31, 2019
0c0cbca
Support basic CREATE VIEW
nickolay Feb 3, 2019
577e634
Update README to the recent changes in the AST
nickolay Jan 30, 2019
2e9da53
Small CLI app that can be used to test parsing an external SQL file
nickolay Jan 30, 2019
b3693bf
Simplify quoted identifier tokenization
nickolay Jan 31, 2019
b9f4b50
Support different quoting styles for delimited identifiers
nickolay Jan 31, 2019
35dd934
Support national string literals (N'...')
nickolay Feb 3, 2019
028c613
Support comments in the tokenizer
nickolay Feb 3, 2019
f958e9d
TBD fixup multiline comment tokenization
nickolay Feb 11, 2019
bf0c07b
Support basic CTEs (`WITH`)
nickolay Feb 3, 2019
bed03ab
Support `AS` and qualified wildcards in SELECT
nickolay Feb 3, 2019
2643193
Support IN
nickolay Feb 10, 2019
786b1cf
Support BETWEEN
nickolay Feb 10, 2019
54c9ca8
Support unary + / -
nickolay Feb 10, 2019
23a0d03
Support NUMERIC without precision or scale
nickolay Feb 10, 2019
533775c
Support CHAR synonym for CHARACTER
nickolay Feb 11, 2019
52e0f55
Support UNION/EXCEPT/INTERSECT
nickolay Feb 7, 2019
23a0fc7
Support CREATE MATERIALIZED VIEW
benesch Mar 6, 2019
f30ab89
Re-run cargo fmt
nickolay Mar 8, 2019
0621f8d
Merge https://github.com/nickolay/sqlparser-rs/pull/1 from benesch/ma…
nickolay Mar 8, 2019
5ba9912
Merge remote-tracking branch 'upstream/master'
nickolay Mar 8, 2019
6dfe7c2
reapply the "Rework keyword/identifier parsing" PR
nickolay Apr 2, 2019
5de23b1
Merge branch 'upstream'
nickolay Apr 2, 2019
311f2ab
bump version to 0.3.0, as requested in the PR
nickolay Apr 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sqlparser"
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
version = "0.2.5-alpha.0"
version = "0.3.0"
authors = ["Andy Grove <[email protected]>"]
homepage = "https://github.com/andygrove/sqlparser-rs"
documentation = "https://docs.rs/sqlparser/"
Expand All @@ -21,3 +21,6 @@ path = "src/lib.rs"
log = "0.4.5"
chrono = "0.4.6"
uuid = "0.7.1"

[dev-dependencies]
simple_logger = "1.0.1"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ println!("AST: {:?}", ast);
This outputs

```rust
AST: SQLSelect { projection: [SQLIdentifier("a"), SQLIdentifier("b"), SQLLiteralLong(123), SQLFunction { id: "myfunc", args: [SQLIdentifier("b")] }], relation: Some(SQLIdentifier("table_1")), selection: Some(SQLBinaryExpr { left: SQLBinaryExpr { left: SQLIdentifier("a"), op: Gt, right: SQLIdentifier("b") }, op: And, right: SQLBinaryExpr { left: SQLIdentifier("b"), op: Lt, right: SQLLiteralLong(100) } }), order_by: Some([SQLOrderBy { expr: SQLIdentifier("a"), asc: false }, SQLOrderBy { expr: SQLIdentifier("b"), asc: true }]), group_by: None, having: None, limit: None }
AST: [SQLSelect(SQLSelect { projection: [SQLIdentifier("a"), SQLIdentifier("b"), SQLValue(Long(123)), SQLFunction { id: "myfunc", args: [SQLIdentifier("b")] }], relation: Some(Table { name: SQLObjectName(["table_1"]), alias: None }), joins: [], selection: Some(SQLBinaryExpr { left: SQLBinaryExpr { left: SQLIdentifier("a"), op: Gt, right: SQLIdentifier("b") }, op: And, right: SQLBinaryExpr { left: SQLIdentifier("b"), op: Lt, right: SQLValue(Long(100)) } }), order_by: Some([SQLOrderByExpr { expr: SQLIdentifier("a"), asc: Some(false) }, SQLOrderByExpr { expr: SQLIdentifier("b"), asc: None }]), group_by: None, having: None, limit: None })]
```

## Design
Expand Down
46 changes: 46 additions & 0 deletions examples/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
extern crate simple_logger;
extern crate sqlparser;
///! A small command-line app to run the parser.
/// Run with `cargo run --example cli`
use std::fs;

use sqlparser::dialect::GenericSqlDialect;
use sqlparser::sqlparser::Parser;

fn main() {
simple_logger::init().unwrap();

let filename = std::env::args()
.nth(1)
.expect("No arguments provided!\n\nUsage: cargo run --example cli FILENAME.sql");

let contents =
fs::read_to_string(&filename).expect(&format!("Unable to read the file {}", &filename));
let without_bom = if contents.chars().nth(0).unwrap() as u64 != 0xfeff {
contents.as_str()
} else {
let mut chars = contents.chars();
chars.next();
chars.as_str()
};
println!("Input:\n'{}'", &without_bom);
let parse_result = Parser::parse_sql(&GenericSqlDialect {}, without_bom.to_owned());
match parse_result {
Ok(statements) => {
println!(
"Round-trip:\n'{}'",
statements
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>()
.join("\n")
);
println!("Parse results:\n{:#?}", statements);
std::process::exit(0);
}
Err(e) => {
println!("Error during parsing: {:?}", e);
std::process::exit(1);
}
}
}
Loading