I think it would be nice to have a way to serialize DAL queries. The problem is should the serialization be database dependent or not. If database dependent it is easy because we can just store the SQL. Yet it would not work for noSQL.
My dream has always be to have a non-database-dependent serialization. This would allow creation of a proxy adapter so that two instances of DAL can query each other. On Thursday, 29 March 2012 02:23:29 UTC-5, Limedrop wrote: > > What do you think about adding a serialization function to > gluon.dal.Query? Eg, Query._as_dict() > We could also get the framework to automatically invoke it when saving a > Query/Expression to session. > > On Thursday, March 29, 2012 12:58:41 PM UTC+13, Massimo Di Pierro wrote: >> >> Let me know if you have a proposal to imporve the dal to make this easier. >> >> On Wednesday, 28 March 2012 17:29:49 UTC-5, Limedrop wrote: >>> >>> Sometimes that will be sufficient. The issue is how you turn _lastsql >>> into a gluon.dal object that you can further manipulate. >>> >>> For example, what if you want to do this: >>> >>> _lastsql & (db.person.name == 'John') >>> >>> See the slice if you need to know how to do it. >>> >>> >>> On Thursday, March 29, 2012 5:59:23 AM UTC+13, Cliff wrote: >>>> >>>> Doesn't db._lastsql return a string? Can't you just save that in the >>>> session? >>>> >>>> Or is that a naive question? >>>> >>>> >>>>

