Closed tutiplain closed 2 years ago
Hi @tutiplain , thanks for the report.
What method are you using for the ALTER TABLE
statement? This statement will only succeed if run through the Exec
method. The Query
one will fail since it's only meant to query the data. The mentioned error is returned only if the Query method is used to modify the data.
I am actually using ImmuDB's web console to run the command. I am not using the immuclient at this time.
I noticed this behavior when attempting to use the Migrator function for AddColumn() in the immugorm project, so I decided to attempt doing the Alter Table manually in the web console to see if it was just gorm generating invalid DQL syntax.
ALTER TABLE people ADD phone varchar;
use this
The issue was fixed in webconsole https://github.com/codenotary/immudb-webconsole/pull/13 (updated in immudb in https://github.com/codenotary/immudb/pull/1294).
@tutiplain please check if it works as expected, dev binaries will be available shortly in https://github.com/codenotary/immudb/actions/runs/2731470130 - those are deleted after 1 week.
What happened
Using Immudb version 1.3.1 (darwin, amd64 or linux, amd64) using an ALTER TABLE ADD COLUMN query fails with error message "illegal statement, DQL statement expected".
What you expected to happen
I expected a new column to be added to my table
How to reproduce it (as minimally and precisely as possible)
I created a new table using the the web interface with this DQL query:
create table PEOPLE (id integer , name varchar, last_name varchar,primary key id);
I then attempted to add a new column by using the followinf DQL query:
ALTER TABLE people ADD COLUMN phone varchar;
Environment
Here is the command used to start immudb and its output:
Additional info (any other context about the problem)