Skip to content

feat(workspace): support binary and BLOB data types in DML mutation engine and grid validator #658

Description

@ZhuchkaTriplesix

Motivation & Problem

In lib/core/database/table_mutation_engine.dart, there is no handling for binary data types (bytea, blob, binary, varbinary, bit, raw). When a user edits a binary cell in the Data Grid with a hex string (e.g. \xDEADBEEF, 0xDEADBEEF, DEADBEEF), the mutation engine formats it as a standard string literal '\xDEADBEEF', which causes syntax errors in MySQL (BLOB) and SQLite (BLOB) or typing mismatch in PostgreSQL.

Additionally, GridDataTypeValidator lacks validation for binary / hex formats.

Proposed Solution

  1. In TableMutationEngine:
    • Add _isBinaryType(dataTypeName).
    • Format binary values according to SQL dialect:
      • PostgreSQL: E'\\x...' or '\\x...'::bytea
      • MySQL: X'...'
      • SQLite: X'...'
  2. In GridDataTypeValidator:
    • Add validation for blob, binary, varbinary, and bytea checking for valid hexadecimal representations.
  3. Add unit tests for binary formatting and validation across dialects.

Acceptance Criteria

  • Hexadecimal cell edits on binary columns produce valid SQL literals across PostgreSQL, MySQL, and SQLite.
  • GridDataTypeValidator validates hex strings for binary types and rejects malformed non-hex input.
  • Unit tests pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesterror-handlingTheme parser epic label: error-handlingfrontendTheme parser epic label: frontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions