docs icon indicating copy to clipboard operation
docs copied to clipboard

Document internal serialization formats, because they matter for PKs (as they're size-limited)

Open srh opened this issue 8 years ago • 0 comments

Pasted from https://github.com/rethinkdb/rethinkdb/issues/6304 -- see for some responses.


Please consider documenting how arrays are serialized, in regards to their use for primary keys. On RethinkDB 2.3.5, a simple r.table("test").get([...]) query shows me this error:

Primary key too long (max 127 characters): [
	123,
	1234567890,
	123,
	"foobar12",
	"0123456789abcdefghijklmnopqrstuvwxyz0123456"
] in ...

I've incorrectly assumed - for no particular reason, just had the impression - that the format was JSON or alike, but it doesn't seem to be the case. At least, I can't imagine how this data could be 128 octets-long (value is accepted if I remove any single character anywhere). Result of r.expr([123, 1234567890, 123, "foobar12", "0123456789abcdefghijklmnopqrstuvwxyz0123456"]).toJsonString().count() is 77, and use of info() on such expression returns a 88-character value (because of extra \ns and \ts).

Can someone please enlighten me? Thanks a lot!

srh avatar May 16 '17 20:05 srh