AlecKazakova / sql-psi

An extendable parsing environment for sql which outputs PSI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test fixture failure prevents override of Mixin

griffio opened this issue · comments

Is there a reason that this fixture is designed to fail?

https://github.com/AlecStrong/sql-psi/blob/d4159661beeda531f767707edbec4dd0e3ab3662/test-fixtures/src/main/resources/fixtures/timestamp-literals/Test.s#L25

WHERE date1 > CURRENT_TIME; -- Fails because it is an expression.

The test fixture here is valid syntax on sqlite, mysql and postgresql (ofcourse with re-writing dialect specific elements).
Should it be updated?

The problem is that base fixtures in sql-psi are inherited by sql-delight project fixture tests.
If I override the LiteralValueMixin in, for example, PostgreSql dialect the fixture will still expect to fail.

https://github.com/AlecStrong/sql-psi/blob/master/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/LiteralValueMixin.kt#L27

I have no idea why this valid sql is explicitly disallowed.