schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.58k stars 201 forks source link

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

Open fdietze opened 1 week ago

fdietze commented 1 week ago

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

sualeh commented 1 week ago

@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 commented 1 week ago

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

sualeh commented 1 week ago

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

fdietze commented 1 week ago

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

sualeh commented 1 week ago

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