JakeWheat / simple-sql-parser

SQL parser in Haskell
http://jakewheat.github.io/simple-sql-parser/latest
Other
82 stars 29 forks source link

Mixing default clauses and constraints & columns without types #56

Closed prescientmoon closed 1 month ago

prescientmoon commented 2 months ago

The two PRs conflicted, so I merged them into one.

This PR implements support for such syntax under a new dialect flag. This is a breaking change, as the type for ColumnDef changes.

I added a few tests (as in my past PRs), although I'm not sure I added them to the correct file.

I also didn't use a formatter (as I saw you weren't using one either), so feel free to tweak the code if it looks wonky.

JakeWheat commented 1 month ago

Looks good, but if you don't have the diDefaultClausesAsConstraints flag set, it still parses as if it's set. Is this easy to fix?

JakeWheat commented 1 month ago

Update: it's good enough for now, if someone needs the restriction I can take a look at it, but thinking about it, it's pretty unlikely that anyone will have an issue with this specific thing.