This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 165882

Summary: Cannot find primary key in SQLite Database
Product: db Reporter: tougeo <tougeo>
Component: DB schemaAssignee: Jiri Rechtacek <jrechtacek>
Status: RESOLVED WONTFIX    
Severity: blocker CC: pjiricka, sj-nb
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description tougeo 2009-05-23 17:11:56 UTC
When trying to create an Entity Class from a SQLite database, Netbeans finds no primary keys in all tables.
Comment 1 Jiri Kovalsky 2009-05-25 14:08:17 UTC
This looks like a problem of the wizard and not the SQLite plugin [1]. Reassigning...

[1] http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=16018
Comment 2 Jiri Kovalsky 2009-05-25 14:10:15 UTC
Also changing assignee accordingly for this P1 bug.
Comment 3 Petr Jiricka 2009-05-25 15:28:06 UTC
SQLite is not a supported database, see: http://wiki.netbeans.org/NB67TestedPlatformAndRuntimes
So this is not a 6.7 stopper. Assigning to Tomas to evaluate - thanks.
Comment 4 Sergey Petrov 2009-07-22 11:42:26 UTC
as it's not supported/tested please provide steps to setup sqlite database, I'm currently investigating but it may take
more time without this information. also database structure tables are welcomed, may be database schema, or/and create
table scripts. set as incomplete for now until I will not found how to setup test system.
Comment 5 Sergey Petrov 2009-07-22 13:58:07 UTC
ok, I'm able to connect and see primary key in services but don't see in new entity wizard. investigating.
Comment 6 Sergey Petrov 2009-07-23 10:03:00 UTC
ok,  just tried to create schema first and see there are no indexes for schemas from sqlite, also wizard use schema
inside even if it's not precreated, there is something like org.netbeans.modules.dbschema.TableElement::getPrimaryKey
returns null, all this code is inside of dbschema module, also schema creation is somewhere in this module.
Looks like db problem, reassigning for evaluation.
Comment 7 Jiri Rechtacek 2009-07-23 12:18:17 UTC
TableElement.getPrimaryKey returns null because org.sqlite.MetaData.getIndexInfo always returns java.sql.SQLException:
not yet implemented. As long as SQLite JDBC driver doesn't implement a index support we cannot fix it.
Comment 8 Petr Jiricka 2009-07-23 12:23:38 UTC
Don't we have some infrastructure that allows to bypass buggy JDBC drivers and obtain the schema information some other
way, e.g. through select from system tables?