Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty print BINARY field data #962

Closed
wedi opened this issue Mar 10, 2021 · 2 comments
Closed

Pretty print BINARY field data #962

wedi opened this issue Mar 10, 2021 · 2 comments
Labels
Feature Request New feature or request Low priority Lower priority items PR Welcome Issues and fixes available for wide community to help us move forward by creating a PR with solution

Comments

@wedi
Copy link

wedi commented Mar 10, 2021

It would be cool if Sequel-Ace had an option to encode and display binary fields in some "human readable" form. This would make it possible for a human to check the actual bytes that got stored in the database. Since GUIs are usually designed for humans primarily, one could even argue that this option should be the default. In addition, it became possible to move data via copy and paste without applications choking on "funny" characters.

The following screenshot illustrates quite strikingly what I mean. It's a snippet from a Shopware 6 database. Shopware 6 uses binary keys for Reasons™. On the far right you can see that not all fields are gibberish, but I had to truncate them for pricacy reasons.

grafik

For completenes, here's the SQL to create the tables shown.

CREATE TABLE `order_customer` (
  `id` binary(16) NOT NULL,
  `version_id` binary(16) NOT NULL,
  `customer_id` binary(16) DEFAULT NULL,
  `order_id` binary(16) NOT NULL,
  `order_version_id` binary(16) NOT NULL,
  `email` varchar(254) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salutation_id` binary(16) NOT NULL,
  `first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `custom_fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` datetime(3) NOT NULL,
  `updated_at` datetime(3) DEFAULT NULL,
  `remote_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`,`version_id`),
  KEY `fk.order_customer.customer_id` (`customer_id`),
  KEY `fk.order_customer.order_id` (`order_id`,`order_version_id`),
  KEY `fk.order_customer.salutation_id` (`salutation_id`),
  CONSTRAINT `fk.order_customer.customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk.order_customer.order_id` FOREIGN KEY (`order_id`, `order_version_id`) REFERENCES `order` (`id`, `version_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk.order_customer.salutation_id` FOREIGN KEY (`salutation_id`) REFERENCES `salutation` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@Jason-Morcos Jason-Morcos added Feature Request New feature or request Low priority Lower priority items PR Welcome Issues and fixes available for wide community to help us move forward by creating a PR with solution labels Mar 11, 2021
@jamesstout
Copy link
Contributor

Is viewing as Hex no good? (View->Display Binary Data as Hex)

@wedi
Copy link
Author

wedi commented Mar 15, 2021

Viewing the fields in hex is pretty much what I expected. Neither me nor my colleagues found this. Thanks for the pointer.

There's just a tiny usability issue left: #971

@wedi wedi closed this as completed Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request Low priority Lower priority items PR Welcome Issues and fixes available for wide community to help us move forward by creating a PR with solution
Projects
None yet
Development

No branches or pull requests

3 participants