Subject | Re: [firebird-support] How to mark a database read-only? |
---|---|
Author | Helen Borrie |
Post date | 2008-02-27T23:11:39Z |
At 09:29 AM 28/02/2008, you wrote:
Various data access interfaces - possibly such as whatever you are using - have wrappers that make users and developers think a set is "live". If your components are based on Delphi "dataset" components or similar, there may be properties and methods that can issue parameterised INSERT, UPDATE and DELETE statements to the underlying tables in the database, based on keys and other fields in the dataset. These components might provide these features by default, or not.
Many components have properties to make sets updateable (or not). You'll really need to explore what's available in the data access interface you are using.
Views are not updateable unless triggers are written to make them so (although the picture for this implementation is muddy in earlier versions of Fb).
./heLen
>I found this commandNo: it is an API function call. You can of course *restore* a database as mode read_only. That's how people usually go about deploying a read-only database.
>
>gfix -user SYSDBA -password masterkey dbfile -mode read_only
>
>which makes it possible to do queries on a database file which is
>read-only (located on a read-only filesystem for example). Is there a
>way to accomplish that using a SQL command instead?
>Alternatively is there a way to open a database in read-only modeWell, any query output from a database is read-only - although some ESQL features and the EXECUTE BLOCK statement in DSQL can make a cursor set updateable from an application.
>using QSqlDatabase, even when it has not been marked read_only?
Various data access interfaces - possibly such as whatever you are using - have wrappers that make users and developers think a set is "live". If your components are based on Delphi "dataset" components or similar, there may be properties and methods that can issue parameterised INSERT, UPDATE and DELETE statements to the underlying tables in the database, based on keys and other fields in the dataset. These components might provide these features by default, or not.
>Maybe using setConnectOptions() or some such?A database's mode setting is in the database header itself, not an option at connection. It's an attribute that is available only to the SYSDBA or the database owner to alter.
Many components have properties to make sets updateable (or not). You'll really need to explore what's available in the data access interface you are using.
Views are not updateable unless triggers are written to make them so (although the picture for this implementation is muddy in earlier versions of Fb).
./heLen