beam
beam copied to clipboard
SQLite BINARY field should map to a byte array.
Binary is intended for string data without a collation.
From https://www.sqlite.org/datatype3.html:
- Collating Sequences When SQLite compares two strings, it uses a collating sequence or collating function (two words for the same thing) to determine which string is greater or if the two strings are equal. SQLite has three built-in collating functions: BINARY, NOCASE, and RTRIM.
BINARY - Compares string data using memcmp(), regardless of text encoding. ...
What does it do now?
It maps to an integer.
This actually looks like an issue in the implementation of SQL92 if it's implementing the BINARY collation on text string fields like VARCHAR. I'm not sure though.
See the note here also: http://hackage.haskell.org/package/beam-migrate-0.3.2.1/docs/src/Database.Beam.Migrate.SQL.Tables.html#binary
On Sun, 6 Jan 2019, 00:47 Travis Athougies <[email protected] wrote:
What does it do now?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tathougies/beam/issues/340#issuecomment-451705482, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhbRM09uA1JuA2oKvHLh9JfHXD_sfb-ks5vAUe6gaJpZM4ZoBX3 .
Sorry, 92 is the wrong standard. The BINARY type in MySQL might be what has confused me.
binary in beam-migrate refers to the standard BINARY type. I think these should map to ByteString, not Integer.
And then, you're saying we can achieve this behavior on SQLite using the binary collation on strings?
Consider ShortByteString or other alternative over ByteString if you don't want pinned memory.