1
Fork 0

refactor the identifier syntax

This commit is contained in:
Jake Wheat 2016-02-12 14:13:47 +02:00
parent 52f035b718
commit aa5c2e89c7
16 changed files with 830 additions and 826 deletions
tools/Language/SQL/SimpleSQL

View file

@ -76,125 +76,125 @@ grant, etc
> (TestStatement ansi2011
> "grant all privileges on tbl1 to role1"
> $ GrantPrivilege [PrivAll]
> (PrivTable [Name "tbl1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "tbl1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant all privileges on tbl1 to role1,role2"
> $ GrantPrivilege [PrivAll]
> (PrivTable [Name "tbl1"])
> [Name "role1",Name "role2"] WithoutGrantOption)
> (PrivTable [Name Nothing "tbl1"])
> [Name Nothing "role1",Name Nothing "role2"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant all privileges on tbl1 to role1 with grant option"
> $ GrantPrivilege [PrivAll]
> (PrivTable [Name "tbl1"])
> [Name "role1"] WithGrantOption)
> (PrivTable [Name Nothing "tbl1"])
> [Name Nothing "role1"] WithGrantOption)
> ,(TestStatement ansi2011
> "grant all privileges on table tbl1 to role1"
> $ GrantPrivilege [PrivAll]
> (PrivTable [Name "tbl1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "tbl1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant all privileges on domain mydom to role1"
> $ GrantPrivilege [PrivAll]
> (PrivDomain [Name "mydom"])
> [Name "role1"] WithoutGrantOption)
> (PrivDomain [Name Nothing "mydom"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant all privileges on type t1 to role1"
> $ GrantPrivilege [PrivAll]
> (PrivType [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivType [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant all privileges on sequence s1 to role1"
> $ GrantPrivilege [PrivAll]
> (PrivSequence [Name "s1"])
> [Name "role1"] WithoutGrantOption)
> (PrivSequence [Name Nothing "s1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant select on table t1 to role1"
> $ GrantPrivilege [PrivSelect []]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant select(a,b) on table t1 to role1"
> $ GrantPrivilege [PrivSelect [Name "a", Name "b"]]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> $ GrantPrivilege [PrivSelect [Name Nothing "a", Name Nothing "b"]]
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant delete on table t1 to role1"
> $ GrantPrivilege [PrivDelete]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant insert on table t1 to role1"
> $ GrantPrivilege [PrivInsert []]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant insert(a,b) on table t1 to role1"
> $ GrantPrivilege [PrivInsert [Name "a", Name "b"]]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> $ GrantPrivilege [PrivInsert [Name Nothing "a", Name Nothing "b"]]
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant update on table t1 to role1"
> $ GrantPrivilege [PrivUpdate []]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant update(a,b) on table t1 to role1"
> $ GrantPrivilege [PrivUpdate [Name "a", Name "b"]]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> $ GrantPrivilege [PrivUpdate [Name Nothing "a", Name Nothing "b"]]
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant references on table t1 to role1"
> $ GrantPrivilege [PrivReferences []]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant references(a,b) on table t1 to role1"
> $ GrantPrivilege [PrivReferences [Name "a", Name "b"]]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> $ GrantPrivilege [PrivReferences [Name Nothing "a", Name Nothing "b"]]
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant usage on table t1 to role1"
> $ GrantPrivilege [PrivUsage]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant trigger on table t1 to role1"
> $ GrantPrivilege [PrivTrigger]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant execute on specific function f to role1"
> $ GrantPrivilege [PrivExecute]
> (PrivFunction [Name "f"])
> [Name "role1"] WithoutGrantOption)
> (PrivFunction [Name Nothing "f"])
> [Name Nothing "role1"] WithoutGrantOption)
> ,(TestStatement ansi2011
> "grant select,delete on table t1 to role1"
> $ GrantPrivilege [PrivSelect [], PrivDelete]
> (PrivTable [Name "t1"])
> [Name "role1"] WithoutGrantOption)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] WithoutGrantOption)
skipping for now:
@ -219,7 +219,7 @@ functions, etc., by argument types since they can be overloaded
> ,(TestStatement ansi2011
> "create role rolee"
> $ CreateRole (Name "rolee"))
> $ CreateRole (Name Nothing "rolee"))
12.5 <grant role statement>
@ -235,16 +235,16 @@ functions, etc., by argument types since they can be overloaded
> ,(TestStatement ansi2011
> "grant role1 to public"
> $ GrantRole [Name "role1"] [Name "public"] WithoutAdminOption)
> $ GrantRole [Name Nothing "role1"] [Name Nothing "public"] WithoutAdminOption)
> ,(TestStatement ansi2011
> "grant role1,role2 to role3,role4"
> $ GrantRole [Name "role1",Name "role2"]
> [Name "role3", Name "role4"] WithoutAdminOption)
> $ GrantRole [Name Nothing "role1",Name Nothing "role2"]
> [Name Nothing "role3", Name Nothing "role4"] WithoutAdminOption)
> ,(TestStatement ansi2011
> "grant role1 to role3 with admin option"
> $ GrantRole [Name "role1"] [Name "role3"] WithAdminOption)
> $ GrantRole [Name Nothing "role1"] [Name Nothing "role3"] WithAdminOption)
12.6 <drop role statement>
@ -254,7 +254,7 @@ functions, etc., by argument types since they can be overloaded
> ,(TestStatement ansi2011
> "drop role rolee"
> $ DropRole (Name "rolee"))
> $ DropRole (Name Nothing "rolee"))
12.7 <revoke statement>
@ -277,14 +277,14 @@ functions, etc., by argument types since they can be overloaded
> ,(TestStatement ansi2011
> "revoke select on t1 from role1"
> $ RevokePrivilege NoGrantOptionFor [PrivSelect []]
> (PrivTable [Name "t1"])
> [Name "role1"] DefaultDropBehaviour)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1"] DefaultDropBehaviour)
> ,(TestStatement ansi2011
> "revoke grant option for select on t1 from role1,role2 cascade"
> $ RevokePrivilege GrantOptionFor [PrivSelect []]
> (PrivTable [Name "t1"])
> [Name "role1",Name "role2"] Cascade)
> (PrivTable [Name Nothing "t1"])
> [Name Nothing "role1",Name Nothing "role2"] Cascade)
<revoke role statement> ::=
@ -298,18 +298,18 @@ functions, etc., by argument types since they can be overloaded
> ,(TestStatement ansi2011
> "revoke role1 from role2"
> $ RevokeRole NoAdminOptionFor [Name "role1"]
> [Name "role2"] DefaultDropBehaviour)
> $ RevokeRole NoAdminOptionFor [Name Nothing "role1"]
> [Name Nothing "role2"] DefaultDropBehaviour)
> ,(TestStatement ansi2011
> "revoke role1,role2 from role3,role4"
> $ RevokeRole NoAdminOptionFor [Name "role1",Name "role2"]
> [Name "role3",Name "role4"] DefaultDropBehaviour)
> $ RevokeRole NoAdminOptionFor [Name Nothing "role1",Name Nothing "role2"]
> [Name Nothing "role3",Name Nothing "role4"] DefaultDropBehaviour)
> ,(TestStatement ansi2011
> "revoke admin option for role1 from role2 cascade"
> $ RevokeRole AdminOptionFor [Name "role1"] [Name "role2"] Cascade)
> $ RevokeRole AdminOptionFor [Name Nothing "role1"] [Name Nothing "role2"] Cascade)
> ]