Re: [DB-SIG] paramstyles (mysql string length?)

2006-04-20 Thread Chris Clark
My vote - +1 for making qmark mandatory and everything else optional My ramblings - M.-A. Lemburg wrote: > Markers such as %i and %s could be treated as meaning: bind > these variables as integer and string. This implicit type > information might be vital to some modules. > > I have to confess

Re: [DB-SIG] paramstyles (mysql string length?)

2006-04-24 Thread Chris Clark
In reference to finding question marks in SQL queries and ignoring string literals M.-A. Lemburg wrote: > Does anyone know a good implementation of such a search&replace > mechanism ? > I've not seen any existing code to deal with this BUT there are a couple of places to check: * SnakeSQ

Re: [DB-SIG] pyodbc on osx?

2006-08-14 Thread Chris Clark
Chris Curvey wrote: > I really like the pyodbc package for getting to MS-SQL on Windows. > Has anyone been able to make this work with ODBC drivers on OSX? (Or > is there another open source solution that works?) I've not tried it personally, I get the impression pyodbc is Windows focused at

[DB-SIG] Metadata interface - was Re: Cursor.description when Cursor.rowcount == 0

2006-11-10 Thread Chris Clark
Art Protin wrote: > Dear folks, > Carsten Haese wrote: >> On Fri, 2006-11-10 at 19:03 +0100, M.-A. Lemburg wrote: >> >>> It is common practice to do >>> >>> cursor.execute('select * from mytable where 1=0') >>> print cursor.description >>> > The DBMS that I am writing the interface for

Re: [DB-SIG] Extending DB-API

2006-11-22 Thread Chris Clark
M.-A. Lemburg wrote: >Mario Frasca wrote: > > >>On 2006-1121 16:23:26, M.-A. Lemburg wrote: >> >> >>>Mario Frasca wrote: >>> >>> [...] it would be nice (I mean, I think it would) if also the logging policy would be stated in the db-api2++ >>>I'm not really su

Re: [DB-SIG] Controlling return types for DB APIs

2007-04-17 Thread Chris Clark
Michael Bayer wrote: > However i might suggest that this whole thread, "controlling return > types", perhaps be expanded to include "controlling *input* types and > return types" The pysqlite register_adapter and register_converter do this (in that order). I've not used it in

Re: [DB-SIG] Controlling return types for DB APIs

2007-04-20 Thread Chris Clark
Anthony Tuininga wrote: I've been following this thread and it would appear that no real consensus has been reached as of yet. I've looked at the api used by sqlite and knowing its storage and type definition system it makes good sense. I am considering adding the following to cx_Oracle, followin

Re: [DB-SIG] client side sub queries

2007-05-23 Thread Chris Clark
Carl Karsten wrote: > Carsten Haese wrote: > >> On Tue, 22 May 2007 17:33:27 -0500, Carl Karsten wrote >> >>> Or some such abomination of results of one query as a parameter of a >>> 2nd. >>> >>> given my use case, I can understand why this isn't in the spec, and >>> why it may never be.

Re: [DB-SIG] paramstyles, again (and now voting)

2007-06-04 Thread Chris Clark
+1 on qmark +0 on named +0 on numeric -1 on format -1 on pyformat -- wish I could vote -2 ;-) ___ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig

Re: [DB-SIG] inserting or importing csv file to a sqlite3 connected table

2007-09-12 Thread Chris Clark
Have you taken a look at http://pyxmdb.googlepages.com/ Chris ___ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig

Re: [DB-SIG] Simple? ODBC connection issue

2008-10-16 Thread Chris Clark
On 10/16/2008 5:55 PM, Peter Machell wrote: ...If I hard code the password, the connection works fine: cnxn = pyodbc.connect("DSN=test;UID=test;PWD=test") However substituting a variable fails: passwd='test' connectstring='pyodbc.connect("DSN=test;UID=test;PWD='+passwd+'")' cnxn = connectstrin

Re: [DB-SIG] Test Suite?

2009-10-28 Thread Chris Clark
The great thing about standards is there are so many of them to pick from! I don't recall who originally said that but it is sort of apt here :-) I'm using http://stuartbishop.net/Software/DBAPI20TestSuite/ which is the original that Vernon was referring to. Vernon is your Launchpad project on

[DB-SIG] Any IronPython users?

2010-01-21 Thread Chris Clark
Thought I'd check here before I post to the IronPython list. Is anyone here using IronPython with (any kind of) dbapi driver? I pulled down FePy http://fepy.sourceforge.net/ a few months back, added support for Ingres and fixed some problems related to date types (type support was incomplete).

Re: [DB-SIG] How can I reliably detect whether an SQL statement is a Query?

2010-08-03 Thread Chris Clark
Andy Dustman wrote: On Mon, Aug 2, 2010 at 5:57 AM, Vernon Cole wrote: ...1) I am not confident in my ability to understand Regular Expression strings. It seems to me that this code could be confused by the substring 'SELECT' being included as part of a longer string, or in a string lit

Re: [DB-SIG] Python db programming conventions

2010-11-22 Thread Chris Clark
Andy Dustman wrote: On Sun, Nov 21, 2010 at 3:02 PM, John Q. Public wrote: Is this how my createdb() method should look like? How would you write this method so it is both readable and correct? Thank you for your time and patience. def createdb(self): try: con = sqlite3.connect(db

Re: [DB-SIG] About LOB

2011-04-27 Thread Chris Clark
Kwon, Chan Young wrote: > I am implementing new DB API for new Database according to DB API 2.0. (as > C-Extension) > There is no specification about LOB in DB API 2.0 > Especially, I need LOB object for piecewise LOB writing/reading after query > execution. > So I defined my own LOB object. > I

Re: [DB-SIG] About LOB

2011-05-02 Thread Chris Clark
M.-A. Lemburg wrote: Kwon, Chan Young wrote: Hi, Let me describe more... 1. My suggestion of LOB object is kind of Locator object. It does not contain whole massive data. It just passes small piece of data when its methods are called. 2. buffer object is not enough to handle various kinds

Re: [DB-SIG] Some obscurity with paramstyle

2011-07-19 Thread Chris Clark
M.-A. Lemburg wrote: Daniele Varrazzo wrote: On Jul 19, 2011 3:44 AM, "Federico Di Gregorio" wrote: At least 2 drivers (psycopg and pysqlite) provide a Python->backend mechanism based on PEP 246, "Object Adaptation". If other implementors are interested I can write a short explanatio

Re: [DB-SIG] dBase III and VFP tables

2011-07-20 Thread Chris Clark
Carl Karsten wrote: On Tue, Jul 19, 2011 at 6:39 PM, Ethan Furman wrote: I am finally adding Null support to my dbf package (http://pypi.python.org/pypi/dbf) and, as usual, the VFP side is being a pain. The issue is that the Logical, Date, and DateTime field types, even when the table does

[DB-SIG] New dbapi driver for JDBC - jyjdbc

2011-08-11 Thread Chris Clark
I've posted a new (incomplete) dbapi driver at http://code.google.com/p/jyjdbc/ It is a pure Jython JDBC driver, so if customization is needed it is much easier for a Python developer to modify and extend than the regular Java driver that ships with Jython. Right now it works with Ingres

[DB-SIG] ANN: jyjdbc 0.0.2 now available

2011-08-23 Thread Chris Clark
The pure Jython (Python in the JVM) JDBC dbapi pep-249 driver, jyjdbc 0.0.2 is now available from: http://code.google.com/p/jyjdbc/ At the moment jyjdbc passes more of http://stuartbishop.net/Software/DBAPI20TestSuite/ than zxJDBC. I suspect I'm the only user of jyjdbc at the moment :-) I

[DB-SIG] ANN: jyjdbc 0.0.3 now available

2011-08-25 Thread Chris Clark
The pure Jython (Python in the JVM) JDBC dbapi pep-249 driver, jyjdbc 0.0.3 is now available from: http://code.google.com/p/jyjdbc/ Main high light is that it can now be used as a drop in replacement for zxJDBC in most existing applications by simply replacing: from com.ziclix.python.sql im

[DB-SIG] autocommit support in pep-249

2011-09-12 Thread Chris Clark
Hi All, I was discussing with someone today autocommit support and found an area of pep-249 where I think we could improve the wording (and the spec): http://www.python.org/dev/peps/pep-0249/ . .commit() Commit any pending transaction to the database. Note tha

Re: [DB-SIG] autocommit support in pep-249

2011-09-13 Thread Chris Clark
Vernon Cole wrote: Properties are just the right tools for this task, and appear to be the most used solution in popular drivers. I think that term "attributes" is more commonly used, rather than "properties", but I agree completely. "conn.autocommit = True" seems pythonic, as does "if not

Re: [DB-SIG] autocommit support in pep-249

2011-09-13 Thread Chris Clark
Joshua D. Drake wrote: On 09/13/2011 09:39 AM, Chris Clark wrote: Vernon Cole wrote: Properties are just the right tools for this task, and appear to be the most used solution in popular drivers. So I think we have 3 people each advocating slightly different options for what to do when

Re: [DB-SIG] autocommit support in pep-249

2011-09-14 Thread Chris Clark
M.-A. Lemburg wrote: Chris Clark wrote: Hi All, I was discussing with someone today autocommit support and found an area of pep-249 where I think we could improve the wording (and the spec): http://www.python.org/dev/peps/pep-0249/ . .commit() Commit any

Re: [DB-SIG] autocommit support in pep-249

2011-09-14 Thread Chris Clark
Joshua D. Drake wrote: On 09/13/2011 09:12 PM, Michael Bayer wrote: On Sep 13, 2011, at 9:15 PM, Joshua D. Drake wrote: conn=psycopg2.connect("dbname='foo' user='dbuser', AUTOCOMMIT=TRUE) cur = conn.cursor() cur.execute("""INSERT""") cur.execute("""SELECT * from bar""") cur.begin() cur.exe

Re: [DB-SIG] autocommit support in pep-249

2011-09-14 Thread Chris Clark
M.-A. Lemburg wrote: Chris Clark wrote: M.-A. Lemburg wrote: Chris Clark wrote: Hi All, I was discussing with someone today autocommit support and found an area of pep-249 where I think we could improve the wording (and the spec): http://www.python.org/dev/peps/pep-0249

Re: [DB-SIG] need some database API design advice

2012-04-11 Thread Chris Clark
On Wednesday 2012-04-11 12:44 (-0700), Peter Eisentraut wrote: So, in terms of code, which one of these is "better"? 1a. rv = plpy.execute("some SQL command") try: output(rv.colnames()) except SomeException: output("it's a utility command") 1b. rv = plpy.execute("some SQL comm

Re: [DB-SIG] need some database API design advice

2012-04-13 Thread Chris Clark
your new api. I agree with Chris Clark here... doing so saves you complexity in the dbapi layer you intend to write on top of the low level API. That would require populating this structure on every call, which would be expensive for such a low-level API, or turning the attribute into a fake fun

Re: [DB-SIG] Getting a list of tables from a database

2012-05-15 Thread Chris Clark
On Tuesday 2012-05-15 10:16 (-0700), M.-A. Lemburg wrote: What you're describing sounds a lot like the catalog methods in the ODBC standard. Those are typically implemented by either having the ODBC drivers implement a set of queries that generate result sets in a predefined format, or by addin

Re: [DB-SIG] Use of context managers with DB API 2

2012-11-01 Thread Chris Clark
On Thursday 2012-11-01 08:57 (-0700), M.-A. Lemburg wrote: Christoph Zwerschke wrote: We're currently preparing a new release of PyGreSQL and want to make use of context managers. My obvious idea was to let connections and cursors act as context managers that just close themselves, and add a

[DB-SIG] Python trademark in EU

2013-02-14 Thread Chris Clark
If you are based in Europe could you take a look at http://pyfound.blogspot.ca/2013/02/python-trademark-at-risk-in-europe-we.html please? This is slightly off topic for the db-sig list but I can name at least one company on this list who is based in the EU that has Python on their web site :-

Re: [DB-SIG] should precision and sign of decimal(0) be significant?

2013-05-08 Thread Chris Clark
On Wed, 08 May 2013 12:59:08 +0200, M.-A. Lemburg wrote: On 08.05.2013 11:48, Vernon D. Cole wrote: I am working on code (django-mssql) where I found the following test: ##expected = ( ##Decimal('0.00'), ##Decimal('0.0'), ##Decimal('-

Re: [DB-SIG] API 3.0 limiting paramstyle to ['named', 'qmark'] is okay. ('format' is not desirable)

2013-05-20 Thread Chris Clark
On Mon, 20 May 2013 12:40:04 -0400, Michael Bayer wrote: On May 20, 2013, at 11:20 AM, Carl Karsten wrote: Does anyone on in this discussion actually want named parameters for their own use, or does it seem like something someone might want, so lets try to make that happen just in case? I ca

Re: [DB-SIG] paramstyle specification

2013-05-21 Thread Chris Clark
On Tue, 21 May 2013 21:24:19 +0200, M.-A. Lemburg wrote: On 21.05.2013 20:55, Michael Bayer wrote: On May 21, 2013, at 2:30 PM, M.-A. Lemburg wrote: Something we do need to address in a paramstyle spec for qmark and named is SQL comments. Perhaps easiest would be to disallow them in SQL stat

Re: [DB-SIG] Escaping parameter markers

2013-05-23 Thread Chris Clark
On Thu, 23 May 2013 17:44:35 +0200, M.-A. Lemburg wrote: I've done some research on escaping parameter markers. Here's what I came up with: ODBC: Supports only qmark ('?'). The standard doesn't specify an escape sequence for ? in SQL statements. JDBC: Supports qmark ('?') and named (':p

[DB-SIG] bind parameters

2013-05-23 Thread Chris Clark
On Thu, 23 May 2013 16:59:27 +0200, M.-A. Lemburg wrote: On 22.05.2013 00:52, Michael Bayer wrote: As a total aside, I also have issues with some DBAPIs that accept *only* a list for the "sequence", others that accept *only* a tuple (this may be only when the parameter list is empty, however).

Re: [DB-SIG] bind parameters

2013-05-23 Thread Chris Clark
On Thu, 23 May 2013 13:33:20 -0700, Chris Clark wrote: On Thu, 23 May 2013 16:59:27 +0200, M.-A. Lemburg wrote: On 22.05.2013 00:52, Michael Bayer wrote: As a total aside, I also have issues with some DBAPIs that accept *only* a list for the "sequence", others that accept *onl

Re: [DB-SIG] bind parameters and empty parameter lists

2013-05-24 Thread Chris Clark
On Fri, 24 May 2013 10:23:41 +0200, M.-A. Lemburg wrote: On 23.05.2013 23:37, Chris Clark wrote: On Thu, 23 May 2013 13:33:20 -0700, Chris Clark wrote: On Thu, 23 May 2013 16:59:27 +0200, M.-A. Lemburg wrote: On 22.05.2013 00:52, Michael Bayer wrote: As a total aside, I also have issues

Re: [DB-SIG] bind parameters and empty parameter lists

2013-05-24 Thread Chris Clark
On Fri, 24 May 2013 17:53:39 +0100, Daniele Varrazzo wrote: On Fri, 2013-05-24 at 08:54 -0700, Chris Clark wrote: .executemany(sql, [0]) Again, this is valid, a single tuple with an integer value of zero. For consistency between execute and executemany, I think ".executemany(sq

Re: [DB-SIG] Proposal to discontinue pymssql in favor of pyodbc

2017-01-30 Thread Chris Clark
I don’t have any skin in the game (ergo not updating the ticket) that’s the same route I went for the Python access to the Ingres DBMS (with pypyodbc as a fallback). Chris From: DB-SIG [mailto:db-sig-bounces+chris.clark=actian@python.org] On Behalf Of Randy Syring Sent: Wednesday, January

Re: [DB-SIG] Adding Connection.autocommit as standard extension to DB-API 2.0 (PEP 249)

2022-11-03 Thread Chris Clark
Optional extension to pep-249, DB-API 2.0 works for me, where #3 is: 3. We leave these semantics open and up to the database module to determine. For DB-API 3.0 I would prefer we go with option #1 when the setautocommit() method is called. I wouldn’t be completely devastated if I was opt

Re: [DB-SIG] documenting whether or not the seq_of_parameters to executemany is expected to be run in order given

2023-04-07 Thread Chris Clark
Good idea! A statement to the effect that it is DBMS (and potentially driver) dependent seems a good clarification. Chris From: DB-SIG On Behalf Of Mike Bayer Sent: Friday, April 7, 2023 10:15 AM To: db-sig@python.org Subject: [DB-SIG] documenting whether or not the seq_of_parameters to exec