[vlc-devel] [PATCH] Sqlite Module for VLC, GSoC 09
Srikanth Raju
srikiraju at gmail.com
Fri Aug 28 23:03:06 CEST 2009
Hi!
On Sat, Aug 29, 2009 at 2:27 AM, Laurent Aimar<fenrir at via.ecp.fr> wrote:
> Hi,
>
> On Sat, Aug 29, 2009, Srikanth Raju wrote:
>> > Is so many functions really needed ?
>> >
>> > IMHO, merging pf_set_database and pf_open_database in the module Open
>> > and pf_close_database in the module Close function would simplify it
>> > without any loss. It would also prevent stupid usage mistakes.
>> >
>>
>> Perhaps people don't want to create a connection until required?
> You can then load the sql module when you want the connection and
> destroy it when you don't want it anymore.
There is no added overhead for this that would be of concern? I will implement
it this way then.
>
>> >> + /** Begin transaction */
>> >> + int (*pf_begintransaction) ( sql_t* );
>> >> +
>> >> + /** Commit transaction */
>> >> + void (*pf_committransaction) ( sql_t* );
>> >> +
>> >> + /** Rollback transaction */
>> >> + void (*pf_rollbacktransaction) ( sql_t* );
>> > Is the separation into 4 functions really needed ? And if so why ?
>> >
>
>> The other three are for transactions. We could have a single function
>> with a parameter for which transactional procedure to call. But is that really
>> easier? It's like having "vlc_mutex_proc(Lock) and vlc_mutex_proc(Unlock)"
> It depends, if the only valid way is:
> begin(); query(); if(commit()) rollback(); end(); then a unique query() doing
> all that is to be prefered.
>
You can also do begin(); query(); query(); query(); if( !commit() ) rollback();
:)
> --
> fenrir
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
--
Regards,
Srikanth Raju
More information about the vlc-devel
mailing list