[Lazarus] SQLDB - Can't attach second SQLite database because transaction

Ludo Brands ludo.brands at free.fr
Mon Jan 7 16:47:27 CET 2013


On 07/01/2013 16:01, Michael Van Canneyt wrote:
>
>
> On Mon, 7 Jan 2013, Krzysztof wrote:
>
>>
>>
>>
>> 2013/1/7 Michael Van Canneyt <michael at freepascal.org>
>>
>> Maybe we should make a method for this in TSQLite3Connection ?
>>
>>
>> It would be great. Because without this we can't use all 
>> opportunities of SQLite, like attaching databases or also VACUUM 
>> (trim and pack database)
>
> I meant a method Procedure AttachDatabase(Const AFileName, AnAlias : 
> String);
> ?
>
> Other methods can also be added, of course.
>
A method to execute a statement outside a transaction would also be 
useful for the following reasons:
- Some statements end implicitly a transaction. Ex: 
http://dev.mysql.com/doc/refman/5.0/en/implicit-commit.html or all 
oracle DDL statements. sqldb is not aware that the transaction is 
terminated and its state doesn't match the db state.
- You can't make a method for every database command that has to run 
outside a transaction. Just take a look at the long list of sqlite 
PRAGMA commands that, for some, can't be executed inside a transaction. 
On top of that the list changes considerably between the different 
databases and the confusion between the different db method variations 
can become very big. Fe in SQLServer you can also attach a database with 
a SQL statement but the parameters are quite different : 
http://msdn.microsoft.com/en-us/library/ms176061.aspx.
- A lot of these commands are non SQL standard and have been introduced 
over time which raises also the question of version compatibility when 
implementing sqldb methods to support them.

Ludo







More information about the Lazarus mailing list