SchemaCrawler icon indicating copy to clipboard operation
SchemaCrawler copied to clipboard

Generated columns with `stored` in sqlite are not marked as generated

Open fdietze opened this issue 1 year ago • 5 comments

Description

It seems like generated columns with stored in sqlite are not marked as generated.

How to Reproduce

create the following schema with sqlite:

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

Then, on that column .isGenerated is false. Without the stored keyword, it is true.

Relevant log output

No response

SchemaCrawler Version

16.21.1

Java Version

21

Operating System and Version

NixOS unstable

Relational Database System and Version

sqlite

JDBC Driver and Version

org.xerial:sqlite-jdbc::3.46.0.0

fdietze avatar Jun 18 '24 14:06 fdietze

@fdietze This is not a SchemaCrawler issue, since SchemaCrawler simply reports the information that the SQLite JDBC driver provides.

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 avatar Jun 18 '24 22:06 sualeh

I created issue https://github.com/xerial/sqlite-jdbc/issues/1132 to make the fix.

sualeh avatar Jun 18 '24 22:06 sualeh

@fdietze Here is the PR I submitted: https://github.com/xerial/sqlite-jdbc/pull/1133

sualeh avatar Jun 18 '24 23:06 sualeh

That was quick. Thank you so much for your work!

fdietze avatar Jun 19 '24 10:06 fdietze

@fdietze The SQLite JDBC driver team has merged the PR. Once they release, I will release a new version of SchemaCrawler.

sualeh avatar Jun 20 '24 13:06 sualeh

@fdietze Please use SchemaCrawler v16.22.1

sualeh avatar Jul 31 '24 01:07 sualeh

You are amazing, thank you so much!

fdietze avatar Jul 31 '24 09:07 fdietze