Closed adriens closed 5 years ago
I tested with Postgres, and it is returning the correct base type for my test schema. You will need to send me a test script to reproduce.
@adriens - please provide me with a test script to reproduce. I cannot reproduce this issue.
Hi @sualeh , sorry for late answser, i was very busy these last days.
for (final Schema schema : catalog.getSchemas()) {
for (final Table table : catalog.getTables(schema)) {
// for each table, count the number of rows
String lSchema = table.getSchema().getName();
String lTableName = table.getName();
String lTableFullName = table.getFullName();
String lTableRemarks = table.getRemarks();
String lTableType = table.getTableType().getTableType();
// fetch columns
for (final Column column : table.getColumns()) {
// names
column.getShortName();
column.getName();
column.getFullName();
column.getOrdinalPosition();
column.getRemarks();
// type centric
column.getDefaultValue();
column.getSize();
// type centric datas : HERE IS THE INTERESTING PART THAT PROVIDES null OBJECTS
column.getColumnDataType().getBaseType().getDatabaseSpecificTypeName();
column.getColumnDataType().getBaseType().getFullName().toString();
column.getColumnDataType().getBaseType().getJavaSqlType().getName();
you can find the code commented out in generateTableColumnsCsv
in `AdditionalCommand
In my case, I do inherits from BaseSchemaCrawlerCommand
Source file is here : https://github.com/adriens/schemacrawler-additional-command-lints-as-csv/blob/master/src/main/java/com/github/adriens/AdditionalCommand.java
Please let me know if you can reproduce it. I'm targetting PostgreSQL.
@adriens - actually. I was requesting some DDL scripts to create the database, since I cannot reproduce the issue. Are you able to provide me a small DDL script?
Hmm, you're right, I did not think that it could have something to deal with types.
here is the DDL I used : https://dbseminar.r61.net/system/files/HR_pgsql.sql
Thanks ! 👍
Actually, I reverted the change. Native types will also have a null base type. I cannot give you a better API experience without changing the API to return an optional.
Environment
Issue
While fetching columns of a table, the method
column.getColumnDataType().getBaseType()
always returnsnull
. All other type method are ok, but this one always returns null.