QUOTE_TEMPLATE = '%s'
--
-- 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.
1. | Traceback (most recent call last): |
Is someone on this?
In my POV, web2py **shouldn't** allow table names with . inside, such as db.define_table('a.b.c'), same thing goes for Fields (i.e., no Field('a.b.c'))
This is mainly due to the fact that accessing that table with db['a.b.c'] is cumbersome and takes managing the resultset a bit harder. Same thing goes for the field needing to be accessed as row['a.b.c'].
I think that web2py should "stick" to db.table.field, that can take whatever name is needed with the support of rname.
let's support ASCII simple table and field names and for any "special needs" that were unachievable before let's stick to "promote" rname as the solution, in which is the user that needs to know how quoting works for his backend.
4) at the Python level we should not allow db.C and db.c because of .table conflicts on windows but it should be possible to map two different names into distinct tables "c" and "C" at the Python level. By default Python models names should be mapped into lower case table names and assume case insensitivity.
I also agree with a previous proposal of breaking the DAL into multiple files. One per each adapter.
I am travelling. Just to confirm what written by Niphlod (go on with the changes you proposed). There are many issues related to quoting. Most of them are cause by too many meanings and uses by different components of the "." symbol. I'll be back with more details later...
The current situation is messed up and this needs to be resolved asap or we may have to revert some of the new features until we get a better solution.
The current situation is messed up and this needs to be resolved asap or we may have to revert some of the new features until we get a better solution.
Or branch?
--
You received this message because you are subscribed to a topic in the Google Groups "web2py-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py-developers/4hzZ4HkNCTo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py-develop...@googlegroups.com.
The only huge problem we're facing right now is case sensitivity and the current "naming scheme" of the .table names that in Windows will never work out. Choosing a different naming scheme would probably end in loops in the code or requiring manual work to "migrate" just the .table files to a new name..... does anyone have a solution for that ?
On Wednesday, 18 December 2013 06:48:24 UTC+11, Niphlod wrote:
nobody is looking at Oracle IMHO
MSSQL should be fixed in trunk, leaving 'a.b.c' out of the picture.
for me trunk is still broken.
in dal.py line 7335 , __get_item__ falls through to converting the field name to a string, and looking for it.
The variable key = 'cm_patient.patient_id'
but row_extra looks like this:
<Row {'[cm_patient].[patient_id]': 0L, '[cm_patient].[surname]': None}>
this works better.
key=str(k.sqlsafe)
--
-- 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 a topic in the Google Groups "web2py-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py-developers/4hzZ4HkNCTo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py-develop...@googlegroups.com.
nobody is looking at Oracle IMHO.
MSSQL should be fixed in trunk, leaving 'a.b.c' out of the picture.
I don't see many users trying to fix adapters and testing them,
Then there is the family of NoSQL, for which tests are "totally" missing: mongodb, couchdb, gae and IMAP (not quite a NoSQL per se but has lots of limits)
I don't see anyone trying to figure out a consistent API or writing tests that could - at least - notify if the subset of operations allowed is broken or not.
To my knowledge, at least couchdb and mongodb are available on travis-ci, so once tests are written, they could very well be starting to phase out from the "experimental" status to the "stable" one.
Tests also forces people to think to what the adapter actually can support instead of randomizing "notimplemented" here and there :-P
tl;dr: I'm not worried about "the big ones" but I'm a little scared that the complete test suite never passed for any of the "lesser known" relational engines.
The nosql world is a totally different matter (being untested and experimental) so I can't really vouch for "maintaining backward compatibility" without someone actually testing trunk regularly
Yes, I think most DBs permit case-sensitivity, but have differing defaults.
...
sum_value = db.chore.chore_value.sum()
children_totals = db((db.job.id.belongs(ids)) &
(db.auth_user.id == db.job.child) &
(db.chore.id == db.job.chore)
).select(db.auth_user.username,sum_value,groupby=db.auth_user.username)
for row in children_totals:
children_payout[row.auth_user.username] = row._extra['SUM(chore.chore_value)']
...
... = row._extra['SUM("chore"."chore_value")']
quoting is done for you if you use the expressions:
row[sum_value]
About experimental state of Firebird adapter:
(Version 2.3.2 (2012-12-17 15:03:30) stable)
.......
I do not understand why there should be a 'block' on using new parameters for DAL. Parameters with sensible defaults are often the easiest and most flexible solution. I therefore strongly believe we should do something like this:
DAL(... quote_template=None|default|chr, force_entity_case=None|upper|lower ...)
to be fair I'm a bit tired of even thinking to new cool features to add only to see them trashed away for backward's compatibility's sake and/or seeing the API complicate even further.
mcm is working on the auto-quoting, so he should be really the one to reply to these posts.
Frankly, ATM it seems that turning it off by default is the only way to preserve backwards compatibility, but I'm - clearly :-P - not happy about it.
--
asking the framework to retain bugs to the end of time is a bit naive
If I were to test the framework and found issues to a 1992 standard (SQL92), and found nothing in the documentation I would think the framework is too buggy and go away.
@Tim,@Alan I think quoting was buggy from the beginning, because, this must be clear, quoting was there already, it quoted only at times and differently, depending on the driver. Before, application code written following the "book" specs could rise an error even on some of the "supported" drivers. I suppose there are still bugs here and there, but being well defined, now a bug is a bug whether in the application or in the framework and has to be fixed and can be fixed.
@All Now, going back to the question of choosing the default, turning off the quoting is very simple, it can be done by setting the quote template to return identity i.e. '%s'. And this turns off quoting for real, while before quoting was used "sometimes" so even with that default some (once buggy) adapters would *NOT* behave exactly as before
p.s. If you are interested in my humble opinion, I think that if one has code that relies on a framework bug
--
3. Optimally, to use parameters as follows:
DAL(... quote_template=None|default|str,
force_entity_case=None|upper|lower ...)where,
quote_template = None: Default, no quoting
quote_template = default: Apply DB adapter default quoting
quote_template = 'str': Apply specific 'str' for quoting
force_entity_case = None: Default; each DB adapter sets its customary default
force_entity_case = upper|lower: DB adapter forces entities to upper|lower case.