开发者

iphone sqlite to Ruby on rails question

Im making an app for iphone that sends for caching an sqlite to a server using Ruby on rails,

The idea is that the user on the iphone create, delete edit data, and then send the db to the computer to check it there, no need to edit in the computer the data (send over internet, so web service and ROR showing the edited db necessary)

I have managed to make work my basic operations on the iphone and basic db in ROR, but I need to know please the following...

  • the coredata saves the data in *.sqlite format, but my ROR db uses a *.sqlite3 format, so do I configure the ROR to use adapter: sqlite??? (what else to do plz??)

or do I need some other step to change the sqlite to sqlite3 format,

I just need some basic caching, so its possible to just sent the sqlite file and open it (processed or not)in my ROR??

or is there something else involved??

ok thank you for helping the noob ;) cheers, good 开发者_运维技巧day!


It would be much simpler to save the file straight to disk than to chuck it into the database, although both are options. To store the file in the db you need to put it in a field for :binary data (blob in mysql). There is a little more to it than that, but it follows a similar pattern to what is required for storing images in a db and that is a popular topic so you should be able to find that info fairly easily. To put it on a disk you just write out the file. I am interested in how you are uploading this file to the server in the first place. Not that it is complex, just that there is more than one way to go about that. Finally I would suggest that you consider using a full blown db like postgres* or mysql to do something like store binary data.

You may be interested in this Stack Overflow question that discusses this topic.
And this tutorial briefly covers storing a files in a db using rails.

*my fave

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜