Binary String Formatting

Feature requests and their debate

Binary String Formatting

Postby mhd » Wed Jun 12, 2013 9:21 am

Currently there's an option to present binary values as strings. If that's not selected, we get e.g. 'binary [16]'.

1. Would it be possible to offer another option to represent binary values as HEX?
2. Copying the value and generating SQL from it uses the GUI representation ('binary [16]' or a string), not some escaped version of the proper value (via DECODE, HEX, HEXTORAW, CAST or whatever the DB offers)

My main motivation for asking about this is Oracle, which chose to represent GUIDs (as created by its internal SYS_GUID) function as RAW values, instead of having some specific type like PostGres's UUID. And one does quite a bit of selecting by GUIDs, so copying and pasting them is a frequent action. One of the main roadblocks that keeps me from using DBeaver more often. Item number one should be easy enough, the second is probably a showcase of database-specific functionality.
mhd
 
Posts: 4
Joined: Wed Jun 12, 2013 8:46 am

Re: Binary String Formatting

Postby Serge » Wed Jun 12, 2013 1:47 pm

Hey,

Yep, it seems that time has come to improve binary data management.
First format (binary [size]) is obsolete. It is almost useless in most cases and I will remove it.
Other possible formats:
- String (current one) - simple conversion of byte array into ASCII-like string
- Hex (something like 0xAABBCC, i.e. each byte converts into two hex characters)
- Base64 form
- Something else?

BTW you can edit raw binary data in hex editor. It will be improved as well.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Binary String Formatting

Postby mhd » Thu Jun 13, 2013 3:26 pm

So do you want to skip the 'binary [size]' representation for values of any size? Just cut off at some specified point in that case?

Regarding other representations, I don't really know about those use cases. Do you really need to cut-and-paste Base64 data enough to make adding it worth the while? Then agaian, most databases seem to have a decoding function for it, so it's probably useful for someone and should be pretty easy to add.

I'd definitely display just the hex digits, without a leading "0x", both in the grid and when copied to the clipboard. Just wastes space and If I remember correctly, there's no real standard for hex literals in databases. I've seen 'DEADBEEF', 0xDEADBEEF and x'DEADBEEF'...
mhd
 
Posts: 4
Joined: Wed Jun 12, 2013 8:46 am

Re: Binary String Formatting

Postby Serge » Thu Jun 13, 2013 9:42 pm

Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb


Return to Feature Requests



Who is online

Users browsing this forum: No registered users and 5 guests