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 268114 - Add window to see all the SQL history entries
Summary: Add window to see all the SQL history entries
Status: NEW
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: Dev
Hardware: PC Other
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-20 11:04 UTC by Christian Lenz
Modified: 2016-10-17 12:40 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2016-09-20 11:04:49 UTC
I really would like to have a window where I have my connections and where I have nodes to expand all SQL queries for each connection like inside the SQL History. I would like to provide a plugin for this, but I don't know whether there is a publich API to read out all SQL history entries. If someone is willing to help me to provide a API or documentation, I will implement it by my own.


Cheers

Chris

P.S. it is related to this ticket: https://netbeans.org/bugzilla/show_bug.cgi?id=153633
Comment 1 matthias42 2016-09-21 20:03:10 UTC
I'm currently more focused on other projects, but I'd be willing to sponsor uploads (you'll need an approved OCA: http://wiki.netbeans.org/FaqWhatIsCA).

The history is located in the db.core module, all relevant code is bundled in the org.netbeans.modules.db.sql.history package.

As you can see there the history itself is backed by an XML file and binding is done via JAXB. The API for db.core is currently friend-only and history is not exported.

Implementing a window could be done if the module itself.

In regard to #153633 a windows and the current dialog do not have to exclude each other.
Comment 2 Christian Lenz 2016-09-22 06:56:34 UTC
Are you working on other projects on Netbeans?

With the OCA I only can contribute to the real netbeans source and I can't create a plugin, or?
Comment 3 matthias42 2016-09-22 17:13:10 UTC
(In reply to ChrisLE from comment #2)
> Are you working on other projects on Netbeans?

Nope - outside the netbeans project (in any case I'm not employed by oracle, I just happenend to take the maintainer role for the DB modules).

> With the OCA I only can contribute to the real netbeans source and I can't
> create a plugin, or?

The OCA is currently needed to get changes into the netbeans codebase. With the current modules you'd need an implementation dependency on db.core to access the SQL history, this won't be fun to maintain.

If you want to work outside the netbeans codebase and create a plugin to support this, you can check if you can use the yenta module, that allows changing friend modules, whether it also allows implementation dependency like access I don't know.
Comment 4 Christian Lenz 2016-10-17 12:40:46 UTC
Ok I figured out that I can access the sql history via the sql_history.xml and the SQL Commands will be saved inside SQL files in Roaming/NetBeans/8.2/config/Database. This will be only a workaround but I think this is ok for the first try. :)