From daniele.varrazzo at gmail.com Mon Dec 3 02:42:25 2012 From: daniele.varrazzo at gmail.com (Daniele Varrazzo) Date: Mon, 3 Dec 2012 01:42:25 +0000 Subject: [DB-SIG] Use of context managers with DB API 2 In-Reply-To: <509786BC.5060904@egenix.com> References: <509280C4.10806@online.de> <5092988A.1010709@egenix.com> <50929C02.5040703@actian.com> <50939832.9070006@online.de> <50957704.4040509@egenix.com> <50959FBA.6000506@online.de> <5095A3A8.6080702@egenix.com> <10C0E596-D712-45CD-A7CC-FE36F5585C1E@zzzcomputing.com> <5096537C.90200@online.de> <84B3C290-E15F-47B4-9B94-3F1ED65401B6@zzzcomputing.com> <5096EB35.9000706@online.de> <509786BC.5060904@egenix.com> Message-ID: On Mon, Nov 5, 2012 at 9:28 AM, M.-A. Lemburg wrote: > On 04.11.2012 23:24, Christoph Zwerschke wrote: >> To wrap everything up, as a result of our discussion, I will do the following in the next version of >> PyGreSQL: >> >> * make connections context managers for transactions >> (may not be the optimal solution, but it's already established) >> * make cursors self-closing context managers (evident) >> * not implement shortcut functions (see above) >> >> Is everybody happy with that? > > Sounds good :-) Is there a final wording for the context managers in the dbapi? -- Daniele From wilk at flibuste.net Mon Dec 3 09:31:11 2012 From: wilk at flibuste.net (wilk) Date: Mon, 3 Dec 2012 08:31:11 +0000 (UTC) Subject: [DB-SIG] paramstyle without knowing the database Message-ID: Hi, I did a litle function to use the same paramstyle regardless of the paramstyle of the database. I transform one paramstyle to an other (a code missing in the lib standard isn't it ?) But of course i need to know the paramstyle of the database. I didn't found any way to retrieve it from the connexion. Did i missed something?? Is there a project to have one paramstyle mandatory for all the database?? I'm afraid that because there is not people will not use it at all and use manual string escape wich is a big security hole (i've seen that from people comming from php). Thanks for your attention to my bad english... -- William Dod? Informaticien Ind?pendant From mal at egenix.com Mon Dec 3 09:57:03 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 03 Dec 2012 09:57:03 +0100 Subject: [DB-SIG] paramstyle without knowing the database In-Reply-To: References: Message-ID: <50BC695F.7020004@egenix.com> On 03.12.2012 09:31, wilk wrote: > Hi, > > I did a litle function to use the same paramstyle regardless of the > paramstyle of the database. I transform one paramstyle to an other (a > code missing in the lib standard isn't it ?) There are a few such libraries out there which take care of such conversions. The standard itself cannot provide an example implementation. > But of course i need to know the paramstyle of the database. I didn't > found any way to retrieve it from the connexion. Did i missed > something ? No, the standard only defines a per module global for the paramstyle. We might want to extend this to connections and cursors as well in DB APi 3.0, to make it easier to write such conversion routines, and then perhaps also make those attributes writable, so that the paramstyle can be adjusted on a per connection and cursor basis. > Is there a project to have one paramstyle mandatory for all the > database ? I'm afraid that because there is not people will not use it > at all and use manual string escape wich is a big security hole (i've > seen that from people comming from php). For DB-API 3.0 there's a proposal to make support for the two paramstyles 'named' and 'qmark' mandatory (but leave all existing styles in the standard), or reduce the number of standard paramstyles to these two. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Dec 03 2012) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-11-28: Released eGenix mx Base 3.2.5 ... http://egenix.com/go36 2013-01-22: Python Meeting Duesseldorf ... 50 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From mal at egenix.com Mon Dec 3 10:01:37 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 03 Dec 2012 10:01:37 +0100 Subject: [DB-SIG] Use of context managers with DB API 2 In-Reply-To: References: <509280C4.10806@online.de> <5092988A.1010709@egenix.com> <50929C02.5040703@actian.com> <50939832.9070006@online.de> <50957704.4040509@egenix.com> <50959FBA.6000506@online.de> <5095A3A8.6080702@egenix.com> <10C0E596-D712-45CD-A7CC-FE36F5585C1E@zzzcomputing.com> <5096537C.90200@online.de> <84B3C290-E15F-47B4-9B94-3F1ED65401B6@zzzcomputing.com> <5096EB35.9000706@online.de> <509786BC.5060904@egenix.com> Message-ID: <50BC6A71.2030504@egenix.com> On 03.12.2012 02:42, Daniele Varrazzo wrote: > On Mon, Nov 5, 2012 at 9:28 AM, M.-A. Lemburg wrote: >> On 04.11.2012 23:24, Christoph Zwerschke wrote: >>> To wrap everything up, as a result of our discussion, I will do the following in the next version of >>> PyGreSQL: >>> >>> * make connections context managers for transactions >>> (may not be the optimal solution, but it's already established) >>> * make cursors self-closing context managers (evident) >>> * not implement shortcut functions (see above) >>> >>> Is everybody happy with that? >> >> Sounds good :-) > > Is there a final wording for the context managers in the dbapi? No, not yet. I wanted to add some text, but got distracted by other things. I'll try to get around to it this week, unless someone beats me to it :-) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Dec 03 2012) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-11-28: Released eGenix mx Base 3.2.5 ... http://egenix.com/go36 2013-01-22: Python Meeting Duesseldorf ... 50 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From daniele.varrazzo at gmail.com Mon Dec 3 11:29:17 2012 From: daniele.varrazzo at gmail.com (Daniele Varrazzo) Date: Mon, 3 Dec 2012 10:29:17 +0000 Subject: [DB-SIG] Use of context managers with DB API 2 In-Reply-To: <50BC6A71.2030504@egenix.com> References: <509280C4.10806@online.de> <5092988A.1010709@egenix.com> <50929C02.5040703@actian.com> <50939832.9070006@online.de> <50957704.4040509@egenix.com> <50959FBA.6000506@online.de> <5095A3A8.6080702@egenix.com> <10C0E596-D712-45CD-A7CC-FE36F5585C1E@zzzcomputing.com> <5096537C.90200@online.de> <84B3C290-E15F-47B4-9B94-3F1ED65401B6@zzzcomputing.com> <5096EB35.9000706@online.de> <509786BC.5060904@egenix.com> <50BC6A71.2030504@egenix.com> Message-ID: On Mon, Dec 3, 2012 at 9:01 AM, M.-A. Lemburg wrote: > On 03.12.2012 02:42, Daniele Varrazzo wrote: >> On Mon, Nov 5, 2012 at 9:28 AM, M.-A. Lemburg wrote: >>> On 04.11.2012 23:24, Christoph Zwerschke wrote: >>>> To wrap everything up, as a result of our discussion, I will do the following in the next version of >>>> PyGreSQL: >>>> >>>> * make connections context managers for transactions >>>> (may not be the optimal solution, but it's already established) >>>> * make cursors self-closing context managers (evident) >>>> * not implement shortcut functions (see above) >>>> >>>> Is everybody happy with that? >>> >>> Sounds good :-) >> >> Is there a final wording for the context managers in the dbapi? > > No, not yet. I wanted to add some text, but got distracted by other > things. I'll try to get around to it this week, unless someone beats > me to it :-) I'd just like to be sure that the version I've implemented (as described here: ) is conform to the specs or if it requires any tweak. -- Daniele From mal at egenix.com Mon Dec 3 13:03:08 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 03 Dec 2012 13:03:08 +0100 Subject: [DB-SIG] Use of context managers with DB API 2 In-Reply-To: References: <509280C4.10806@online.de> <5092988A.1010709@egenix.com> <50929C02.5040703@actian.com> <50939832.9070006@online.de> <50957704.4040509@egenix.com> <50959FBA.6000506@online.de> <5095A3A8.6080702@egenix.com> <10C0E596-D712-45CD-A7CC-FE36F5585C1E@zzzcomputing.com> <5096537C.90200@online.de> <84B3C290-E15F-47B4-9B94-3F1ED65401B6@zzzcomputing.com> <5096EB35.9000706@online.de> <509786BC.5060904@egenix.com> <50BC6A71.2030504@egenix.com> Message-ID: <50BC94FC.2010504@egenix.com> On 03.12.2012 11:29, Daniele Varrazzo wrote: > On Mon, Dec 3, 2012 at 9:01 AM, M.-A. Lemburg wrote: >> On 03.12.2012 02:42, Daniele Varrazzo wrote: >>> On Mon, Nov 5, 2012 at 9:28 AM, M.-A. Lemburg wrote: >>>> On 04.11.2012 23:24, Christoph Zwerschke wrote: >>>>> To wrap everything up, as a result of our discussion, I will do the following in the next version of >>>>> PyGreSQL: >>>>> >>>>> * make connections context managers for transactions >>>>> (may not be the optimal solution, but it's already established) >>>>> * make cursors self-closing context managers (evident) >>>>> * not implement shortcut functions (see above) >>>>> >>>>> Is everybody happy with that? >>>> >>>> Sounds good :-) >>> >>> Is there a final wording for the context managers in the dbapi? >> >> No, not yet. I wanted to add some text, but got distracted by other >> things. I'll try to get around to it this week, unless someone beats >> me to it :-) > > I'd just like to be sure that the version I've implemented (as > described here: > ) > is conform to the specs or if it requires any tweak. It sounds exactly like what we've discussed. I also plan to add a Python example to illustrate the context manager logic. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Dec 03 2012) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-11-28: Released eGenix mx Base 3.2.5 ... http://egenix.com/go36 2013-01-22: Python Meeting Duesseldorf ... 50 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From wilk at flibuste.net Tue Dec 4 15:55:58 2012 From: wilk at flibuste.net (wilk) Date: Tue, 4 Dec 2012 14:55:58 +0000 (UTC) Subject: [DB-SIG] paramstyle without knowing the database References: <50BC695F.7020004@egenix.com> Message-ID: On 03-12-2012, M.-A. Lemburg wrote: > On 03.12.2012 09:31, wilk wrote: >> Hi, >> >> I did a litle function to use the same paramstyle regardless of the >> paramstyle of the database. I transform one paramstyle to an other (a >> code missing in the lib standard isn't it ?) > > There are a few such libraries out there which take care of > such conversions. Do you have a link to one that do only that ? Thanks for the clue about dbapi 3.0 > The standard itself cannot provide an example > implementation. > >> But of course i need to know the paramstyle of the database. I didn't >> found any way to retrieve it from the connexion. Did i missed >> something ? > > No, the standard only defines a per module global for the > paramstyle. > > We might want to extend this to connections and cursors > as well in DB APi 3.0, to make it easier to write such conversion > routines, and then perhaps also make those attributes writable, > so that the paramstyle can be adjusted on a per connection and > cursor basis. > >> Is there a project to have one paramstyle mandatory for all the >> database ? I'm afraid that because there is not people will not use it >> at all and use manual string escape wich is a big security hole (i've >> seen that from people comming from php). > > For DB-API 3.0 there's a proposal to make support for the two > paramstyles 'named' and 'qmark' mandatory (but leave all existing > styles in the standard), or reduce the number of standard > paramstyles to these two. > -- William Dod? Informaticien Ind?pendant From mal at egenix.com Tue Dec 4 16:10:51 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 04 Dec 2012 16:10:51 +0100 Subject: [DB-SIG] paramstyle without knowing the database In-Reply-To: References: <50BC695F.7020004@egenix.com> Message-ID: <50BE127B.3050701@egenix.com> On 04.12.2012 15:55, wilk wrote: > On 03-12-2012, M.-A. Lemburg wrote: >> On 03.12.2012 09:31, wilk wrote: >>> Hi, >>> >>> I did a litle function to use the same paramstyle regardless of the >>> paramstyle of the database. I transform one paramstyle to an other (a >>> code missing in the lib standard isn't it ?) >> >> There are a few such libraries out there which take care of >> such conversions. > > Do you have a link to one that do only that ? There's one such module in the PyDal package: http://pydal.sourceforge.net/ called paramstyles.py: https://pydal.svn.sourceforge.net/svnroot/pydal/trunk/dal/dbapi/paramstyles.py which is an N-way converter. > Thanks for the clue about dbapi 3.0 > > >> The standard itself cannot provide an example >> implementation. >> >>> But of course i need to know the paramstyle of the database. I didn't >>> found any way to retrieve it from the connexion. Did i missed >>> something ? >> >> No, the standard only defines a per module global for the >> paramstyle. >> >> We might want to extend this to connections and cursors >> as well in DB APi 3.0, to make it easier to write such conversion >> routines, and then perhaps also make those attributes writable, >> so that the paramstyle can be adjusted on a per connection and >> cursor basis. >> >>> Is there a project to have one paramstyle mandatory for all the >>> database ? I'm afraid that because there is not people will not use it >>> at all and use manual string escape wich is a big security hole (i've >>> seen that from people comming from php). >> >> For DB-API 3.0 there's a proposal to make support for the two >> paramstyles 'named' and 'qmark' mandatory (but leave all existing >> styles in the standard), or reduce the number of standard >> paramstyles to these two. >> > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Dec 04 2012) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-11-28: Released eGenix mx Base 3.2.5 ... http://egenix.com/go36 2013-01-22: Python Meeting Duesseldorf ... 49 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From info at egenix.com Fri Dec 14 09:05:27 2012 From: info at egenix.com (eGenix Team: M.-A. Lemburg) Date: Fri, 14 Dec 2012 09:05:27 +0100 Subject: [DB-SIG] ANN: eGenix mxODBC Connect - Python Database Interface 2.0.2 Message-ID: <50CADDC7.2090009@egenix.com> ________________________________________________________________________ ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 2.0.2 mxODBC Connect is our commercially supported client-server product for connecting Python applications to relational databases in a truly cross-platform way. This announcement is also available on our web-site for online reading: http://www.egenix.com/company/news/eGenix-mxODBC-Connect-2.0.2-GA.html ________________________________________________________________________ INTRODUCTION The mxODBC Connect Database Interface for Python allows users to easily connect Python applications to all major databases on the market today in a highly portable, convenient and secure way. Python Database Connectivity the Easy Way ----------------------------------------- Unlike our mxODBC Python extension, mxODBC Connect is designed as client-server application, so you no longer need to find production quality ODBC drivers for all the platforms you target with your Python application. Instead you use an easy to install royalty-free Python client library which connects directly to the mxODBC Connect database server over the network. This makes mxODBC Connect a great basis for writing cross-platform multi-tier database applications and utilities in Python, especially if you run applications that need to communicate with databases such as MS SQL Server and MS Access, Oracle Database, IBM DB2 and Informix, Sybase ASE and Sybase Anywhere, MySQL, PostgreSQL, SAP MaxDB and many more, that run on Windows or Linux machines. Ideal for Database Driven Client Applications --------------------------------------------- By removing the need to install and configure ODBC drivers on the client side and dealing with complicated network setups for each set of drivers, mxODBC Connect greatly simplifies deployment of database driven client applications, while at the same time making the network communication between client and database server more efficient and more secure. For more information, please have a look at the mxODBC Connect product page, in particular, the full list of available features. For more information, please see the product page: http://www.egenix.com/products/python/mxODBCConnect/ ________________________________________________________________________ NEWS The 2.0.2 release of mxODBC Connect includes the following enhancements and fixes: Security Enhancements --------------------- * Upgraded client and server to eGenix pyOpenSSL 0.13.0-1.0.1c. Server Enhancements ------------------- * Added support for unlimited connection licenses. * The server installer on Windows will now install the Microsoft Visual C++ 2008 SP1 Redistributable Package (if necessary) instead of shipping with side-by-side runtime DLLs. This resolves installation issues on fresh Windows server installations. * Improved the active connection logging to show more accurate figures in situations where a lot of new connections are opened at once. * mxODBC Connect Server will now free resources on broken connections much earlier than before. The setting is configurable using the max_session_reconnect_time parameter in the server's [Activity] configuration and defaults to 60 seconds. Client Enhancements ------------------- * No fixes were necessary. Misc ---- * Added a note that even with an unlimited license, the server sill uses an adjustable max_session configuration parameter to limit the effect of denial-of-service attacks. mxODBC Connect 2.0 was released on 2012-08-20. These are the highlights of the new release: mxODBC Connect 2.0 Enhanced API ------------------------------- * mxODBC Connect Server now uses mxODBC 3.2 internally and makes its API available in the mxODBC Connect Client. This is a major step forward from the mxODBC 3.0 version used in mxODBC Connect Server 1.0. * mxODBC Connect Client comes with all the mxODBC enhancements, including: - connection and cursor objects can be used as context managers - adjustable parameter styles (qmark or named) - connection .autocommit attribute to easily switch on autocommit - adjustable timestamp resolution - new possibilities to set connection and cursor options to adjust the ODBC objects to your application needs, e.g. set a connection read-only or set a query timeout - adjustable decimal, datetime and string formats - adjustable warning format to be able to handle server warnings without client interaction - greatly improved result set scrolling support - Unicode support for all catalog methods - Access to additional result set meta data via cursor.getcolattribute() Updated Compatibility --------------------- * The server now features all the ODBC driver compatibility enhancements provided by mxODBC 3.2, including improved and updated support for MS SQL Server Native Client, Oracle Instant Client, Sybase ASE, IBM DB2, Teradata and Netezza. * Native Windows x64 builds with signed executables and a tray app rewritten in C are available for Windows 2008R2, Vista and 7 x64, so you can benefit from better performance, fewer UAC dialogs and smaller memory footprint. Asynchronous Execution ---------------------- * mxODBC Connect Client now integrates directly with gevent, allowing client applications to run asynchronous tasks while performing remote database queries. Better Integration ------------------ * mxODBC Connect now uses the official IANA registered port 6632 for both plain text and SSL-encrypted communication. * mxODBC Connect Client now allows selecting the used SSL module from two available options: Python standard lib ssl module and pyOpenSSL. For the full set of changes, please check the mxODBC Connect change log. http://www.egenix.com/products/python/mxODBCConnect/changelog.html ________________________________________________________________________ UPGRADING You are encouraged to upgrade to this latest mxODBC Connect release. When upgrading, please always upgrade both the server and the client installations to the same version - even for patch level releases. Customers who have purchased mxODBC Connect 2.0 licenses can continue to use their licenses with this patch level release. Customers who have purchased mxODBC Connect 1.x licenses can request 20% discount coupons for upgrade purchases. Please contact the eGenix.com Sales Team (sales at egenix.com) with your existing license serials for details. Users of our stand-alone mxODBC product will have to purchase new licenses from our online shop in order to use mxODBC Connect. You can request 30-day evaluation licenses by visiting our web-site or writing to sales at egenix.com, stating your name (or the name of the company) and the number of eval licenses that you need. http://www.egenix.com/products/python/mxODBCConnect/#Evaluation ________________________________________________________________________ DOWNLOADS The download archives as well as instructions for installation and configuration of the product can be found on the product page: http://www.egenix.com/products/python/mxODBCConnect/ If you want to try the package, jump straight to the download instructions: https://cms.egenix.com/products/python/mxODBCConnect/#Download Fully functional evaluation licenses for the mxODBC Connect Server are available free of charge: http://www.egenix.com/products/python/mxODBCConnect/#Evaluation mxODBC Connect Client is always free of charge. _______________________________________________________________________ SUPPORT Commercial support for this product is available from eGenix.com. Please see http://www.egenix.com/services/support/ for details about our support offerings. _______________________________________________________________________ INFORMATION About Python (http://www.python.org/): Python is an object-oriented Open Source programming language which runs on all modern platforms. By integrating ease-of-use, clarity in coding, enterprise application connectivity and rapid application design, Python establishes an ideal programming platform for today's IT challenges. About eGenix (http://www.egenix.com/): eGenix is a software project, consulting and product company focusing on expert services and professional quality products for companies, Python users and developers. Enjoy, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Dec 14 2012) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-12-05: Released eGenix pyOpenSSL 0.13 ... http://egenix.com/go37 2012-11-28: Released eGenix mx Base 3.2.5 ... http://egenix.com/go36 2013-01-22: Python Meeting Duesseldorf ... 39 days to go ::::: Try our mxODBC.Connect Python Database Interface for free ! :::::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/