Hi Everyone,

I am using dataobjects together with datamapper in a merb based
application that serves static data (as in changes once every three
months - public transport schedule information) from a sqlite
database.

Since the app is a read-only app I'd like to be able to open the
sqlite3 connection in read only mode.

To be able to do that the

sqlite3_open_v2()

function needs to be used instead of sqlite3_open(). This function is
available in sqlite3 since 3.5.0.

http://www.sqlite.org/c3ref/open.html

I've been using this setup on the iPhone OS quite happily for quite
some time and I know how to do it and I am more than willing to
provide a patch.

Looking at 
http://github.com/sam/do/blob/a37977996aa044e53ba2bb393e13f19e0a8ad20d/do_sqlite3/ext/do_sqlite3_ext/do_sqlite3_ext.c

it seems to me that the best approach would be that the read_only mode
parameter be encoded in the connection url as a query parameter (the
code seems to anticipate such things).

Is it ok? Should I do this?

If yes, I've got some questions:

- naturally, we'd like to keep backward compatibility with sqlite3 <
3.5.0 (the flag would be ignored)

   - do you know a way how top postpone checking if sqlite3_open_v2()
is available from compile time to runtime? Or should i resort to
#ifdefs?

Ognen

P.S. If all thumbs up, how do I submit a patch?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to