dbvisualizer

Is it possible to change the array presentation in DbVisualizer?


In version 24.2 DbVisualizer introduced a new presentation for arrays in the result tab.

In older versions the query SELECT array_agg(x.elem) FROM (VALUES ('abc'), ('def')) x (elem); would have resulted in {abc,def}. Now it is ["abc","def"].

Is there any way, to change the output to the old format?

I'd expected to find a new option in the "Data Format" section of the settings - but there is none.


Solution

  • (Disclaimer: I am a DbVisualizer developer.)

    DbVisualizer 24.2 made a lot of heavy changes to the way arrays are handled. While the vast majority of these are internal implementation details, the most noticeable change from the end-user point of view is a new JSON-based syntax for presenting array values in the grid.

    While it is our hope that users will adopt the new syntax, we did include an undocumented and not-officially-supported flag to emulate most of the old array behavior, including the old syntax.

    Assuming you are running the standard executable on Windows or Mac, open Tools->Tool Properties... and go to the General panel. Under Java VM Properties, add the following line:

    -Ddbvis.ArrayRepresentation=legacy
    

    Press OK and restart DbVisualizer.

    A screenshot of the Tool Properties panel in DbVisualizer to illustrate where the relevant field is located.

    If you are on Linux and/or launching DbVisualizer through the .bat/.sh scripts, those scripts need to be modified to include the above line as one of the arguments to the JVM invocation.


    As a final note, these changes - including replacing the old syntax - were made in order to make room for potential future enhancements to arrays and similar data types.

    As such, using the flag above to partially disable these changes may or may not also disable certain new functionality in future versions of DbVisualizer.