fernyb / Sequel-J

A MySQL Client written in Cappuccino (work in progress)
31 stars 1 forks source link

Where to store user data (history, favorites etc) #16

Closed joehoyle closed 13 years ago

joehoyle commented 13 years ago

I noticed the Save History had been implemented, seemingly by downloading a file on the user's computer?

I wondered how best to handle the user's favorites, saves queries etc? Perhaps it would be best to store in localStorage (at least for now)?

fernyb commented 13 years ago

Yeah saving to localStorage is probably the best way of doing that now.

Thats why I'm using CPUserDefaults it uses the localStorage if the browser supports it otherwise uses a cookie. (http://cappuccino.org/learn/documentation/interface_c_p_user_defaults.html)

To download the local data it creates an iframe and sends the data to the server and the server then sends an attachment and the browser will then download that attachment.

I took the advice from: http://groups.google.com/group/objectivej/browse_thread/thread/e8242a8d91216741/5276536023f41678?lnk=gst&q=DownloadIFrame&pli=1

joehoyle commented 13 years ago

Ahh I see. I guess for full DB exports we would probably just want the server to pass the export. Rather than DB -> Capp -> Backend -> Download (thinking for very large DBs).

fernyb commented 13 years ago

Yeah for large downloads we just want the server to pass the export.