I use web2py's DAL in my project (daemon).
I modified db.py so that all calls to create_table happen with migrate=False
(because I reuse the same db as in web app).
So all I need from DAL is .select, .update, .delete and .insert. Also I take
care to
call these functions only from single thread. That's all and it works for
me.

Ah, yes, the files: in the current folder I have symlinks to gluon and to
db.py
Also in db.py I have to explicitly check for DAL presence and if missing -
import it from gluon.

On Sat, Aug 28, 2010 at 6:51 AM, Kevin <[email protected]> wrote:

> Of course, it is always an option (and never a difficulty) to wrap
> functional programming concepts in an object oriented wrapper --
> that's more a benefit of the functional style than then anything OOP
> gives to you though.
>
> On Aug 27, 7:13 pm, Thadeus Burgess <[email protected]> wrote:
> > >.< DON'T DO IT!
> >
> > The DAL is ment for functional programming... so be careful if you
> > have to use it in a class based system. Plus you will have to have
> > your stand alone application manage the .table files too. Just keep it
> > in mind.
> >
> > In any case...
> >
> > You will need.
> >
> > gluon/LICENSE
> > gluon/sql.py
> > gluon/portalocker.py
> > gluon/utils.py
> >
> > Also, you will NOT need validators.. so edit gluon/sql.py and comment
> > out anything to do with the following
> >
> > from serializers import json - remove this, it conflicts with the real
> > version of simplejson installed from pypi.
> > from http import HTTP -- doubt you will be making any http exceptions
> > import validators -- unless you are somehow using SQLFORM, you dont
> > need this. Be sure to remove all traces of validators from the rest of
> > sql.py Just do a search for "validators" and remove that code.
> >
> > Yay, you now have a stand alone DAL... see how easy that was to
> > de-couple things?! =)
> >
> > --
> > Thadeus
> >
> > On Fri, Aug 27, 2010 at 6:34 PM, Sujan Shakya <[email protected]>
> wrote:
> > > Hi All,
> >
> > > I'm going to have to use a MySQL orm in a project in near future.
> > > Do you think web2py DAL is good for that purpose regarding scalability
> > > and performance ?
> > > And what files do I need to import or execute to use only web2py DAL ?
> >
> > > Thanks.
> >
> >
>

Reply via email to