RawrUniversal / xerial

Automatically exported from code.google.com/p/xerial
0 stars 1 forks source link

Update to impement additional MetaData methods #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please describe a summary of the new feature (in a paragraph):

I've updated the MetaData.java class to implement the getImportedKeys and
getIndexInfo methods (previously these methods just raised Exceptions). 
Some of the field values are incorrect because SQLite's pragma functions do
not return the data:

For getImportedKeys:

PKTABLE_NAME and FKTABLE_NAME are returned as nulls.  DEFERRABILITY is
always returned as importedKeyNotDeferrable.

For getIndexInfo:

ASC_OR_DESC is returned as null.  CARDINALITY and PAGES are returned as 0.

Foreign Keys with implicitly mapped columns will cause a
java.lang.NullPointerException e.g.

create table CHILD (
CHILD_ID number primary key,
PARENT_ID number references PARENT);

This is due to SQLite returning a null value in the "to" column of the
foreign_key_list pragma.
To avoid this explicitly name the Primary Key columns e.g.

create table CHILD (
CHILD_ID number primary key,
PARENT_ID number references PARENT (PARENT_ID));

Please provide any additional information below:

Diff file has been attached

Original issue reported on code.google.com by Welshmi...@googlemail.com on 7 Aug 2009 at 4:53

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the patch. I'll apply the patch.

Original comment by taroleo on 16 Aug 2009 at 7:41

GoogleCodeExporter commented 8 years ago
Issue 7 has been merged into this issue.

Original comment by taroleo on 16 Aug 2009 at 7:42

GoogleCodeExporter commented 8 years ago
Applied the patch to the version 3.6.17:
http://www.xerial.org/maven/repository/artifact/org/xerial/sqlite-jdbc/3.6.17/

Original comment by taroleo on 18 Aug 2009 at 4:32