[vlc-devel] [PATCH] Sqlite Module for VLC, GSoC 09
Laurent Aimar
fenrir at via.ecp.fr
Fri Aug 28 23:07:32 CEST 2009
On Sat, Aug 29, 2009, Srikanth Raju wrote:
> On Sat, Aug 29, 2009 at 2:27 AM, Laurent Aimar<fenrir at via.ecp.fr> wrote:
> > 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.
I don't think it would matter, the object creation is light.
Will see what other think about it.
> >> 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();
then at least merging commit+rollback+end into end() would simplify no ?
(or whatever name you prefer to keep).
--
fenrir
More information about the vlc-devel
mailing list