Add MSSQL dialect and fix up the postgres' identifier rules

The `@@version` test is MS' dialect of SQL, it seems, so test it with
its own dialect.

Update the rules for identifiers in Postresql dialect per documentation,
while we're at it. The current identifier rules in Postgresql dialect
were introduced in this commit - as a copy of generic rules, it seems:
810cd8e6cf (diff-2808df0fba0aed85f9d35c167bd6a5f1L138)
This commit is contained in:
Nickolay Ponomarev 2019-05-03 03:09:44 +03:00
parent 5047f2c02e
commit 304710d59a
8 changed files with 75 additions and 15 deletions

View file

@ -4,16 +4,6 @@ use sqlparser::dialect::{GenericSqlDialect, PostgreSqlDialect};
use sqlparser::sqlast::*;
use sqlparser::test_utils::*;
#[test]
fn parse_select_version() {
let sql = "SELECT @@version";
let select = pg_and_generic().verified_only_select(sql);
assert_eq!(
&ASTNode::SQLIdentifier("@@version".to_string()),
expr_from_projection(only(&select.projection)),
);
}
#[test]
fn parse_create_table_with_defaults() {
let sql = "CREATE TABLE public.customer (