Fork me on GitHub
#sql
<
2018-02-05
>
Drew Verlee20:02:39

does anyone understand the difference between "data_types" and "type_name" when it comes to jdbc meta data? https://docs.oracle.com/javase/8/docs/api/java/sql/JDBCType.html i thought that this idea has some merit: https://github.com/viesti/table-spec. But i immediatly hit an issue with my database having a uuid. Which is a dataype that isn't known.

seancorfield20:02:49

Ah, you just joined ... I was going to offer this link and see if it helped? https://www.tutorialspoint.com/jdbc/jdbc-data-types.htm

seancorfield20:02:39

Specific database engines will have extensions to these, which makes it more complex. And then there are several Java types that you can choose to represent in SQL in multiple ways (UUID is a good example -- it can be BINARY(16) or CHAR(36) or perhaps several other representations).

Drew Verlee20:02:04

@seancorfield Thanks, that makes sense. I was thinking of modifying that library to A) use just the type_names, as they seem to be more of them and so possible cover more ground. B) use both C) leave a place for some customization on the users end.

Drew Verlee20:02:49

But I need to hunt down the docs on the type_names. Which should just be a matter of looking at the java method that returns it...

Drew Verlee21:02:10

Of course, in order for these sepcs to help. Ppl have to have picked resonable column types...

seancorfield21:02:58

char and varchar and their cousins are going to be pretty open-ended -- and any binary types are going to need to have gone through some sort of transformation -- so I'm not sure where derived specs would help on any of those?

seancorfield21:02:45

(as you might guess, I'm not a fan of database-as-a-model -- I'm more in the database-as-storage camp)