Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDocumentation: PG doesn't accept null bytes in UTF8 #284
Comments
sgrif
added
good first issue
documentation
labels
Apr 22, 2016
This comment has been minimized.
hiimtaylorjones
commented
May 10, 2016
•
|
I'm down to write some docs about this. @dikaiosune - could you maybe provide some common examples where this might occur? I really like the suggestion of documenting what Rust.to.SQL mappings are currently supported by Diesel. I think it'll bring down the amount of Issues of "Why doesn't |
This comment has been minimized.
|
@hiimtaylorjones It came up for me when I was inserting responses from GitHub's API into the database. Still not sure why the heck GitHub was returning null bytes, but it is valid UTF-8, even though (apparently) Postgres doesn't accept null bytes. I've been thinking about writing something similar, but my plate's a little full at the moment. |
This comment has been minimized.
|
Also to clarify, this only affects PG not the text type in general. SQLite handles nul bytes fine. |
This comment has been minimized.
hiimtaylorjones
commented
May 12, 2016
|
@dikaiosune - Sweet. I'll see what I can dig up there. @sgrif - noted. |
This comment has been minimized.
hiimtaylorjones
commented
Feb 17, 2017
|
Hey everyone, This totally fell of my radar. For that, I apologize. Though this conversation is about a year old, I decided to still take a shot at the issue. While, the need for SQL mapping types still exists, I figured that I'd at least write up something to cover the ground in the meantime. That commit can be found here. Please let me know if I'm completely right, wrong, or somewhere in between! As far as the proposed mapping documentation is concerned, where exactly would be the best place to insert that documentation? |
killercup
added this to API docs
in Documentation
Feb 17, 2017
This comment has been minimized.
|
This is now documented on the |
anp commentedApr 19, 2016
It would be good to document the fact that diesel doesn't sanitize 0x00 from Rust's String type, which causes a runtime error when using the postgres backend. Also would be good to mention that it's problematic from an API perspective, as it would add non-trivial overhead to String serialization, along with low-overhead strategies for mitigating.
Maybe this could be a part of either a document on various backend idiosyncrasies, or possibly a document covering the various Rust type -> SQL type mappings that diesel supports.