schemacrawler / SchemaCrawler

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

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

Closed fdietze closed 3 months ago

fdietze commented 4 months 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 4 months 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 4 months ago

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

sualeh commented 4 months ago

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

fdietze commented 4 months ago

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

sualeh commented 4 months ago

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

sualeh commented 3 months ago

@fdietze Please use SchemaCrawler v16.22.1

fdietze commented 3 months ago

You are amazing, thank you so much!