rangy serialized selection and mysql database field

35 views
Skip to first unread message

Jeff Baker

unread,
Aug 23, 2013, 3:07:23 PM8/23/13
to ra...@googlegroups.com
I am going to store rangy serialized selection into a mysql database field.  I am thinking I should use varchar for the type.  But I'm not sure how many characters I should allow for.  What is the longest that a serialized selection will come to?

Thanks,
Jeff

Tim Down

unread,
Aug 24, 2013, 1:33:00 PM8/24/13
to rangy
There is theoretically no limit. It depends entirely on the depth of the DOM. Sorry.

Tim


--
You received this message because you are subscribed to the Google Groups "rangy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rangy+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jeff Baker

unread,
Aug 24, 2013, 2:26:10 PM8/24/13
to ra...@googlegroups.com
Thanks for the information Tim.  I suppose I should use datatype TEXT then?

Jeff



--
You received this message because you are subscribed to a topic in the Google Groups "rangy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rangy/ojWQvAFiEEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rangy+un...@googlegroups.com.

Tim Down

unread,
Aug 24, 2013, 3:15:00 PM8/24/13
to rangy
It's up to you, really. The serialized selection is made up of some fixed length stuff (checksum, separator character) plus two serialized selection boundaries, which could be any length but take the form a/b/c/..... where each of a, b, c etc. is a child node index allowing the deserializer to drill down through the DOM from the document at the top to get to the node containing the selection boundary. In practice, unless you have a really deeply nested DOM, you could probably get away with a generous character limit (100 would be plenty, I'd imagine) on the database field.

Tim

Jeff Baker

unread,
Aug 28, 2013, 1:52:30 PM8/28/13
to ra...@googlegroups.com
Thanks Tim. I suppose I could use VARCHAR(100) for the rangy serialized datatype then?

Jeff
Reply all
Reply to author
Forward
0 new messages