Changing the behavior of _<db command> in NoSQL subclasses

28 views
Skip to first unread message

Alan Etkin

unread,
Jan 10, 2014, 9:56:13 AM1/10/14
to web2py-d...@googlegroups.com
On the reverted patch from

https://github.com/web2py/web2py/pull/341

The use of the change in the function standard output format is returning a relevant data for the nosql engine. Can't we afford the change of behavior for this cases? I have already implemented those methods in that way for other non-sql experimental engines.

Massimo DiPierro

unread,
Jan 10, 2014, 5:55:56 PM1/10/14
to web2py-d...@googlegroups.com
For SQL database the db(...)._<something> functions produce SQL output. For NoSQL they also produce a string representation of the query (default SQL). This is useful for logging and debugging. We can change this but 1) why? 2) what should the rule be? 3) if we end with different behavior for different adapters why do we need to use these standard functions names then?

massimo


--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alan Etkin

unread,
Jan 11, 2014, 5:37:50 AM1/11/14
to web2py-d...@googlegroups.com

For SQL database the db(...)._<something> functions produce SQL output. For NoSQL they also produce a string representation of the query (default SQL).
> This is useful for logging and debugging.

Ok. I really missed that functionality for NoSQL backends, I suppose my change can even break compatibility with apps implementing debugging features relying in defaults, so I agree with the revert.

We can change this but 1) why?

We should not change _<something> behavior. NoSQL adapters should always use defaults for consistency

Now for non rdbms, sometimes you need to pre-process the db command input so the adapter returns the resulting row data without applying changes to the backend. Both for debugging purposes and for use cases like the one detailed in https://groups.google.com/d/msg/web2py/lFKiIGary0c/xv4fcCz8DvMJ

AFAIK the current api does not support this, with the exception of the wrong implementations in gae (reverted), imap and mongodb.

Then we could add support for pre-processing db commands in dal by adding methods with different naming or else leave the feature to ad-hoc external implementations.

Alan Etkin

unread,
Jan 11, 2014, 8:00:57 AM1/11/14
to web2py-d...@googlegroups.com

AFAIK the current api does not support this, with the exception of the wrong implementations in gae (reverted), imap and mongodb.

For now, I have removed those adapter methods so there are no conflicts with the base api

https://github.com/web2py/web2py/pull/343

Reply all
Reply to author
Forward
0 new messages