The use case should have as minimal an impact on the database -- assume I'm 
not allowed to create new tables or even views, nor can I create a new user 
or permissions on the database. So it needs to be a code-level solution. 
Right now I just check for some common mutating sql, like "delete from" or 
"insert into" and raise an exception if I see those.

On Sunday, October 18, 2015 at 6:14:09 AM UTC-7, Ofer Nave wrote:
>
> That's a creative solution -- though I don't know the OP's full use case; 
> if he wants to access most or all of his tables in RO mode, that could get 
> tedious and hard to maintain.
>
> Another might be to run a pair of DBs master/slave streaming replication 
> setup, which usually automatically protects against writes to the slave.  
> Then just connect to the slave.
>
> I did a quick search through the Opening Databases doc (
> http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html) 
> and RDoc for the Sequel::Database object and didn't see any general options 
> along those lines (except when using SQLite).  However, you can also run 
> arbitrary SQL, so you might want to check your database's docs for modes 
> you can set.  For example, I'm using MySQL, and I set some modes when I 
> first connect.
>
> -ofer
>
> On Sunday, October 18, 2015 at 5:39:47 AM UTC-4, Christian MICHON wrote:
>>
>> You should instead create views on your SQL database and access only 
>> these views through sequel.
>> On Oct 18, 2015 5:24 AM, "Jeff" <[email protected]> wrote:
>>
>>> I actually mean Sequel.connect(...), not connection. 
>>>
>>> On Saturday, October 17, 2015 at 8:22:55 PM UTC-7, Jeff wrote:
>>>>
>>>> Is there an option in Sequel.connection (or another Sequel method) to 
>>>> only allow read-only operations on the database, even if the user's 
>>>> permissions would allow more? Just want to enforce more safety if possible.
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "sequel-talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/sequel-talk.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to