http://code.google.com/r/thadeusburgess-web2py/source/detail?r=63967d6739efa4a3b60c909a82f981ca2f464028
Ok take a look at this now. I am happy with this. It only adds around
15kb added memory on my system, none if you have the check disabled.
I did move the keywords to a separate file. You were right in that it
would make dal.py much bigger than any of us would bear. It only
imports the tuples if you are using check_reserved.
The advantage, sql.py supports the checking too! :)
Here is how to use it. Note you will probably want to disable this for
production. Just set check_reserved=None (the default)
db = DAL('sqlite://mydb.db', check_reserved=['mssql', 'postgres'])
check_reserve -- list of adapters to check tablenames and column names
against sql reserved keywords
Is a list containing the adapter names, all, or common.
(Default None)
common -- List of sql keywords that are common to all
database types such as "SELECT, INSERT". (recommended)
all -- Checks against all known SQL keywords. (not recommended)
<adaptername> -- Checks against the specific adapters
list of keywords (recommended)
<adaptername>_nonreserved -- Checks against the specific
adapters list of nonreserved keywords. (if available)
I have added mssql, and oracle.
I need
'sqlite': SQLITE,
'db2': DB2,
'informix': INFORMIX,
'ingres': INGRES,
'ingresu': INGRES,
'jdbc:sqlite': JDBCSQLITE,
'jdbc:postgres': JDBCPOSTGRESQL,
-Thadeus
On Fri, Feb 5, 2010 at 12:16 AM, Thadeus Burgess <[email protected]> wrote:
> I now have postgres as well.
>
> -Thadeus
>
>
>
>
>
> On Thu, Feb 4, 2010 at 9:49 PM, Jonathan Lundell <[email protected]> wrote:
>> On Feb 4, 2010, at 7:19 PM, Thadeus Burgess wrote:
>>
>>> A quick question, what is your opinion on non-reserved keywords ?
>>> Should they be included, excluded, separated ? non-reserved words are
>>> acceptable and do not get in the way of your queries.
>>
>> I don't know enough to have an opinion, but if they're not reserved, what
>> the heck?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/web2py?hl=en.
>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.