xerial / sqlite-jdbc

SQLite JDBC Driver
Apache License 2.0
2.74k stars 598 forks source link

Generated columns with `stored` in SQLite are not marked as generated #1132

Closed sualeh closed 1 week ago

sualeh commented 1 week ago

Description Generated columns are not reported as such by database metadata.

To Reproduce Create the following table with SQLite :

create table foo (
  id integer primary key,
  bar int not null generated always as (id + 1) stored
);

On the bar column IS_GENERATEDCOLUMN is NO with DatabaseMetaData.getColumns. Without the stored keyword, it is YES.

Expected Behavior On the bar column IS_GENERATEDCOLUMN should be YES with DatabaseMetaData.getColumns.

Additional Context See JDBC3DatabaseMetaData. It only checks for a value of "2", when according to the SQLite documentation, it should be checking for both 2 and 3.

sualeh commented 1 week ago

Corresponding test is DBMetaDataTest