PDO and database abstraction
Hi all, I'm testing the PDO wrapper to database modules [1] and I'm wondering how few things like this there are around. My problem, actually, is the paramstyle of modules. I want to use kinterbasdb in the same code I use cx_oracle, for example, but paramstyle changes from one to other, than I searched for things like this and found nothing really usefull. The problem with PDO is that it was so dificult to find, since a few people seems to use it, and I haven't yet figured how to change the paramstyle on it, so I want to ask: Do you use a thing like this that you would recommend to me? Thanks, Luiz Carlos Geron [1] http://pdo.neurokode.com -- http://mail.python.org/mailman/listinfo/python-list
Re: PDO and database abstraction
Excuse me if I wasn't clear. I don't want to use ORMs, since I really have to execute arbitrary sql queries, and then I can't use this object mapping. I'm going to write my own wrapper like you did, it is not so difficult to do. -- http://mail.python.org/mailman/listinfo/python-list
Re: PDO and database abstraction
This is one example where I need to use such abstraction: I have a dictionary with the fields and values to be inserted into the database, with a code like this: dic = {'field1' : 1, 'field2' : 2} #this dict comes from a Cherrypy request cur.execute('update table set field_one = :value1, field2 = :value2' , dic) and I want to use it even with kinterbasdb, wich does not support named paramstyle. The problem with your use of % is that the db module does not automatically put '' in varchar fields, and so on. This is what PDO does, or say that does. I think that I should make a wrapper that simply swap :var to ? when the db paramstyle is qmark, and so on. Is this correct? -- http://mail.python.org/mailman/listinfo/python-list
Re: Client side web programming
Maybe this will be useful to you: http://www.python.org/pypi/mechanoid/0.6.8 -- http://mail.python.org/mailman/listinfo/python-list
Re: How to generate graphics dynamically on the web using Python CGI script?
I don't have experience on this, but I think that you can make the script return the image "contents" directly to the img tag, without passing it to a img file, so you can use something like this: wich saves some processing and I/O. -- http://mail.python.org/mailman/listinfo/python-list