Skip to content

Commit

Permalink
Added failing test for parsing table names starting with public
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Jun 11, 2022
1 parent 403149f commit 8daccc7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Test/IDE/SchemaDesigner/ParserSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,10 @@ COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UU
it "should parse 'DROP FUNCTION ..' statements" do
let sql = cs [plain|DROP FUNCTION my_function;|]
parseSql sql `shouldBe` DropFunction { functionName = "my_function" }

it "should parse 'CREATE TABLE ..' statements when the table name starts with public" do
let sql = cs [plain|CREATE TABLE public_variables (id UUID);|]
parseSql sql `shouldBe` StatementCreateTable {unsafeGetCreateTable = CreateTable {name = "public_variables", columns = [Column {name = "id", columnType = PUUID, defaultValue = Nothing, notNull = False, isUnique = False, generator = Nothing}], primaryKeyConstraint = PrimaryKeyConstraint {primaryKeyColumnNames = []}, constraints = []}}

col :: Column
col = Column
Expand Down

0 comments on commit 8daccc7

Please sign in to comment.