dolt diff -r sql doesn't show values for BIT(n) types
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 108
Description
When I try to extract diff data (but also try to show data, but for the diff it's most critical) that is of a BIT(n) type I get empty strings instead some value that can be fed back into a `dolt sql` statement. I use BIT types pretty often for flags, status fields and other tiny integers smaller than a full byte so being able to export them like so would be a great help for sure. Maybe even implementing a default way to show them other than converting them to a character (which is probably what's the underlying issue right now). My suggestion would be to just use the `b'000'` notation like when typing them in.
```bash
$ dolt init --fun
Successfully initialized dolt data repository.
$ dolt sql -q "CREATE TABLE t (id INT PRIMARY KEY, some_bitval BIT(3))"
$ dolt sql -q "INSERT INTO t (id, some_bitval) VALUES ROW(0, b'000'), ROW(1, b'001'), ROW(2, b'010')"
$ dolt sql -q "SELECT * FROM t"
+----+-------------+
| id | some_bitval |
+----+-------------+
| 0 | |
| 1 | |
| 2 | |
+----+-------------+
$ dolt diff HEAD -r sql
CREATE TABLE `t` (
`id` int NOT NULL,
`some_bitval` bit(3),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
INSERT INTO `t` (`id`,`some_bitval`) VALUES (0,);
INSERT INTO `t` (`id`,`some_bitval`) VALUES (1,);
INSERT INTO `t` (`id`,`some_bitval`) VALUES (2,);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.