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
- In
TableMutationEngine:
- Add
_isBinaryType(dataTypeName).
- Format binary values according to SQL dialect:
- PostgreSQL:
E'\\x...' or '\\x...'::bytea
- MySQL:
X'...'
- SQLite:
X'...'
- In
GridDataTypeValidator:
- Add validation for
blob, binary, varbinary, and bytea checking for valid hexadecimal representations.
- Add unit tests for binary formatting and validation across dialects.
Acceptance Criteria
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,
GridDataTypeValidatorlacks validation for binary / hex formats.Proposed Solution
TableMutationEngine:_isBinaryType(dataTypeName).E'\\x...'or'\\x...'::byteaX'...'X'...'GridDataTypeValidator:blob,binary,varbinary, andbyteachecking for valid hexadecimal representations.Acceptance Criteria
GridDataTypeValidatorvalidates hex strings for binary types and rejects malformed non-hex input.