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
CREATETABLEmy_data (
id INTEGERNOT NULLPRIMARY KEY,
data BLOB
);
ALTERTABLE my_data ADD COLUMN object_id AS ( data->>'id' );
-- the following doesn't work either-- ALTER TABLE my_data ADD COLUMN object_id AS ( json_extract(data, '$.id') );
SQL queries
-- name: GetIDs :manySELECT object_id FROM my_data;
ALTER TABLE my_data ADD COLUMN object_id TEXT AS ( data->>'id' );
-- instead of
ALTER TABLE my_data ADD COLUMN object_id AS ( data->>'id' );
dvob
changed the title
sqlite ALTER TABLE ADD COLUMN with generated columns and json functions panics
sqlite ALTER TABLE ADD COLUMN without type name panics
May 12, 2024
Use type name 'any' for ALTER TABLE t1 ADD COLUMN c1 where no type
name for c1 is provided. This is the same logic as for CREATE TABLE.
Fixessqlc-dev#3375
dvob
linked a pull request
May 12, 2024
that will
close
this issue
Version
1.26.0
What happened?
sqlc panics after i've added a migration which adds a generated column which uses a json function
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/f925d1924e8a01e5ebb440040403c046229225dfd1e42b5f0fb6d839b0d9d3e2
What operating system are you using?
Linux
What database engines are you using?
SQLite
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: