From: Adam B. <ad...@po...> - 2002-06-12 23:07:47
|
> > [Arrays vs. 'IN'] > > Right, and there's no way of knowing what the database engine expects for > > that parameter until it has parsed the statement. > Unless you also parse at the client side, which I'd rather not ;-) > There might be a solution with controlling the behaviour using a flag in the > cursor object, for example. But what will happen when someone passes many different parameters to execute() function, some of them being arrays which have to be converted to "'{one,two,three}'" and some to "('one', 'two', 'three')"? I think the only good way would be to leave current cursor object behaviour as it is and add new class (call it PgSet, for instance), which would be converted to the second form above. What do You think? I agree that it would be useful. However, there are probably many more such situations where a programmer would like to convert automatically a data structure into the SQL expression of his/her choice. I am not sure if it is really good for a general library like pyPgSQL to have so many features not covered by standards. Regards, -- Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |