blob encode uuids if stored as binary #173
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Marking as a draft because I actually don't know if this is the correct solution
I'm using https://github.com/sloanelybutsurely/typeid-elixir which implements an
Ecto.ParameterizedType
that can be either a:string
or:uuid
type. As strings they look like "user_01jz8mgbxkevwagbhr8cdqhpqh"I want to use
ecto_sqlite3
withuuid_type: :binary
for efficiency reasonsStoring the TypeID as
:uuid
will dump the suffix, "01jz8mgbxkevwagbhr8cdqhpqh", creating a binary from the base32 representation — but Ecto blows up inSTRICT
tables withBLOB
columns becausetypeid_elixir
is unawareexqlite
needs to receive{:blob, value}
, not onlyvalue
.I've added blob encoding to the dumper pipeline, but again, maybe this is not the correct solution.