You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE test (
id INTEGER PRIMARY KEY NOT NULL
);
2.sqm
ALTER TABLE test RENAME COLUMN id TO new_id;
test.sq
deleteTest:
DELETE FROM test;
selectTest:
SELECT *
FROM test;
insertTest:
INSERT INTO test (new_id)
VALUES(?);
Stacktrace
There are at least two issues:
SqlColumnAlias doesn't implement SqlColumn in the generated grammar and an alias type in the grammar is incorrect for a renamed column
class com.alecstrong.sql.psi.core.psi.impl.SqlColumnAliasImpl cannot be cast to class com.alecstrong.sql.psi.core.psi.SqlColumnName
SqlColumnAlias is the incorrect type for a renamed column as alias columns are only expected in Result statements and CTE statements hence the illegal state
java.lang.IllegalStateException unexpected column alias parent SqliteAlterTableRenameColumnImpl(ALTER_TABLE_RENAME_COLUMN): .. at com.alecstrong.sql.psi.core.psi.mixins.ColumnAliasMixin.source(ColumnAliasMixin.kt:29)
The text was updated successfully, but these errors were encountered:
SQLDelight Version
2.0.0, 2.0.1
SQLDelight Dialect
sqlite-3-25-dialect or higher
Describe the Bug
Sqlite support for rename table column (sqlite_3_25 and higher) in migrations generates compiler error
This is the same issues that Postgresql has - so fixes will be similar to work done for Postgresql
There is only a test for Postgresql in the migrations compiler test for alter column (not for sqlite)
Steps to generate compile error
1.sqm
2.sqm
test.sq
Stacktrace
There are at least two issues:
SqlColumnAlias
doesn't implementSqlColumn
in the generated grammar and an alias type in the grammar is incorrect for a renamed columnSqlColumnAlias
is the incorrect type for a renamed column as alias columns are only expected in Result statements and CTE statements hence the illegal stateThe text was updated successfully, but these errors were encountered: