0

I have a simple client-side Sqlite database (via. Google Gears) I want to use for persistence of the contents of a javascript object's properties (not methods). I don't really care about normalization since it has lots of potentially disparate fields (primitive types, arrays, objects) that would thwart normalization anyway.

What would be the best way to go about doing this? Or in the worst case, an alternative that at least achieves persistence?

1 Answer 1

1

If you don't need type information for your objects (and they contain no methods, only attributes) why not store your data as JSON?

Sign up to request clarification or add additional context in comments.

3 Comments

And do what with that JSON data that persists it? Stick it all in one big string in a single-item database table?
If you're only using it for persistence and you're not versioning the object in question, then yes, just a single column table will do.
@Hamster -- Glad I could help! The reason I suggest this approach is for speed. Breaking down the object (which will have many disparate fields) just for persistence will slow down the speed of serializing / deserializing the object -- and, according the OP, add no needed functionality to what is being built. Simplicity wins over nifty. :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.