compare

literal

character set

ref https://www.w3schools.com/mysql/mysql_datatypes.asp

Char is Rune when for char/varchar/text, etc; char otherwise.

In Memory

roughly equal to Nim’s length
char Char binary 1
char(size) array[uint8(size), Char] binary(size) size
varchar(max_size) seq[Char] (len ≤ uint16(max_size)high(uint16), also depended on charset) varbinary(max_size) ≤max_size

varchar impl

In Disk

ref https://www.mysqltutorial.org/mysql-basics/mysql-text/

len of unsigned (< 2^(8*sizeof(len)))

sizeof(len) max of high(len)
tinytext 1 tinyblob 255B
text 2 blob 64 KB
mediumtext 3 mediumblob 16MB
longtext 4 longblob 4GB