Decode MessagePack, igbinary, Protobuf and Avro values with Display As

オープン
#3,607 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
kafka, mysql, postgresql, swift

調査の方向性

Start with apple/TablePro/Core/Services/Formatting/ValueDisplayFormat.swift and ValueDisplayFormatter.swift, then review features/json-viewer.mdx and databases/kafka.mdx for existing viewer behavior. Identify how per-column formats and Kafka schema settings are represented before scoping the decoders. Done means reference-library fixtures decode for each format, invalid values fall back to hex with an explanation, and swapped-time UUIDs display as their original UUID.

索引モデルが issue の本文から書いたものです。

説明

enhancement platform-macos
Problem

Display As has seven formats: Raw Value, Text, UUID, two Unix timestamps, JSON and PHP Serialized (features/json-viewer.mdx:14-22, apple/TablePro/Core/Services/Formatting/ValueDisplayFormat.swift:12-19). A binary column that holds a compact serialization shows only hex:

  • MessagePack, common for cache payloads and job queues.
  • igbinary, the binary form of PHP serialization, which the PHP Serialized viewer does not read.
  • Protobuf and Avro. On Kafka, a topic whose values are Avro or Protobuf shows the raw bytes, five-byte wire-format prefix included (databases/kafka.mdx:151-152).

The UUID format also renders the bytes in stored order (apple/TablePro/Core/Services/Formatting/ValueDisplayFormatter.swift:56-74). A MySQL column filled with UUID_TO_BIN(uuid, 1), which moves the time fields to the front, renders as a UUID that differs from the one the application wrote.

Proposed solution
  • MessagePack on binary columns: decoded into the JSON tree viewer, read-only, with badges for bin, ext and timestamp values.
  • igbinary on binary columns: decoded into the PHP serialized viewer's tree.
  • Protobuf on binary columns: with no schema, the wire format as field numbers and wire types. With a .proto file or descriptor set chosen for the column, field names and types.
  • Avro on binary columns: decoded with a writer schema file chosen for the column.
  • On Kafka, a value with the wire-format prefix reads its schema ID, and when the connection names a Schema Registry URL, the Avro or Protobuf schema is fetched from it.
  • UUID (Swapped Time) for UUID_TO_BIN(uuid, 1) columns, and an edit typed as a UUID is written back in the same byte order.
  • Each format behaves like the existing ones: set per column and scoped to the connection and table, rendering only, a single copied cell copies the decoded text, and filters and highlight rules still read the stored value (features/filtering.mdx:32).
  • A value that does not decode falls back to hex, and the viewer says why.

Done when: each format decodes a fixture written by its reference library, a broken value falls back to hex, and a UUID_TO_BIN(uuid, 1) value renders as the UUID passed in.

Alternatives considered

Copy the hex out and decode it with a script, or write a view that decodes on the server where the engine can.

Platform

macOS

Related database type

N/A / General

主要言語
Swift
スター
6.2k
フォーク
412
平均マージ
3時間 56分
マージ済み PR(30日)
669

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TableProApp/TablePro のほかの issue

TableProApp/TablePro の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。