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 154740 - Add ability to export data from results as CSV
Summary: Add ability to export data from results as CSV
Status: NEW
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 8.2
Hardware: All All
: P2 blocker with 6 votes (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
: 72689 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-05 13:55 UTC by Roman Mostyka
Modified: 2016-12-07 14:29 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Prototype build (147.71 KB, application/x-zip)
2013-12-29 23:55 UTC, matthias42
Details
Prototype build v2 (174.99 KB, application/x-zip)
2013-12-31 12:27 UTC, matthias42
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-12-05 13:55:32 UTC
Add ability to export data from results as CSV.
Comment 1 Jiri Rechtacek 2009-10-16 14:14:37 UTC
Reassigned to new owner.
Comment 2 tomzi 2013-10-14 15:29:34 UTC
vote +1: this is sth I just missed too :) have to start sqldeveloper just for that ....
Comment 3 matthias42 2013-12-29 23:55:23 UTC
Created attachment 143513 [details]
Prototype build

I did some work on this a while ago and now I got so far, that I have an early prototype, that does some real work. Please see here:

https://github.com/matthiasblaesing/netbeanscsvexporter

It implements:

- Import/Export filters for conversion of DB-Representation => Text representation and vice-versa
- ability to configure IDE wide presets for imports/exports - including:
  - CSV Parameters
  - Column-Type to converter/config mapping
- A basic task that demonstrates integration into the database explorer (installing the modules gives a new Table context menu entry "Export tables") which then allows to export these tables

Limitations/ToDos:

- Integration into the ResultSet-Displayer (Export visible data / Export all data for select)
- Split into a core and a gui part
- make it work with more databases (should work with all databases supporting LIMIT/OFFSET for client side paging)
- better usability
- implement import
- ability to save export/import configurations
- polish/cleanup
- it runs in the foreground, as the netbeans infrastructure currently does not allow me to get a seperate db-connection

In all fairness I don't know how much time I will throw at this. This currently would only work as either a module inside netbeans (if I remember correctly, most needed APIs are friend-only) or at least tightly coupled with netbeans. Infrastructure changes are required (partly a reiteration of the ToDos):

- db.dataview needs to offer a hook to get the currently executed SQL, add contextmenu-entries and access the current resultset/pseudo resultset
- DatabaseConnection in db needs to offer a way to establish a secondary sql.Connection, that is decoupled from the primary one
- the way SQL generation works needs to looked at again (for example by integrating hibernate dialects as basis), as the current base seems to be neither exposed nor large enough to cover this.
Comment 4 matthias42 2013-12-31 12:27:17 UTC
Created attachment 143537 [details]
Prototype build v2
Comment 5 lathspell 2014-02-14 14:48:03 UTC
Hello matthias42

Can you publish your code on plugins.netbeans.org?
I also miss this feature but dont' want to install the NetBeans SDK "harness" think ant seems to need.

best regards,

-christian-
Comment 6 matthias42 2014-02-16 18:21:43 UTC
Hi Christian,

thank you for your interest. But I won't publish this as a final product. It'll fail in so many cases, that it won't be a good plugin in the current state. What I could do is convert the sources to be maven based. This could make it easier to build.

But attached to this bug, that should be installable.

Greetings

Matthias
Comment 7 matthias42 2014-08-24 20:15:14 UTC
*** Bug 72689 has been marked as a duplicate of this bug. ***
Comment 8 Christian Lenz 2016-12-07 14:29:55 UTC
We really need such feature as here: https://www.jetbrains.com/datagrip/features/importexport.html

scroll to export and see what DataGrip does. It can export to CSV, HTML Table, JSON, SQL with inserts or updates etc. and not only for the result. For result, for data structure for the table, database (I think so) and so on.