[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7695 - in trunk/gnue-common/src/datasources/drivers/sql: interba
From: |
johannes |
Subject: |
[gnue] r7695 - in trunk/gnue-common/src/datasources/drivers/sql: interbase maxdb msado mysql oracle postgresql sqlite |
Date: |
Thu, 7 Jul 2005 06:47:02 -0500 (CDT) |
Author: johannes
Date: 2005-07-07 06:46:55 -0500 (Thu, 07 Jul 2005)
New Revision: 7695
Added:
trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdbdrv.py
trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdbdrv.py
trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapidrv.py
trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldbdrv.py
trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracledrv.py
trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracledrv.py
trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopgdrv.py
trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresqldrv.py
trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsqldrv.py
trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlitedrv.py
Removed:
trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdb.py
trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdb.py
trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py
trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldb.py
trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracle.py
trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracle.py
trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopg.py
trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresql.py
trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsql.py
trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlite.py
Log:
Renamed drivers so __initplugin__ will really work
Deleted: trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdb.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdb.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdb.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,214 +0,0 @@
-# GNU Enterprise Common Library - Firebird database driver using KinterbasDB
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for Firebird/Interbase backends using the KinterbasDB
-DBSIG2 module.
-"""
-
-__all__ = ['Connection']
-
-from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources.drivers.sql.interbase import Behavior
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import kinterbasdb
- except ImportError:
- raise GConnections.DependencyError, ('Kinterbasdb', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "kinterbasdb Firebird/Interbase Driver"
-
- url = "http://kinterbasdb.sourceforge.net"
-
- doc = """
-Description
------------
-Written by Alexander Kuznetsov, kinterbasdb provides support for
-Firebird and Interbase.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - MS Windows 98/NT/2000/XP (Installer available)
-
-
-Connection Properties
----------------------
-* host -- This is the hostname running your database server (optional)
-* dbname -- This is the name of the database to use (required)
-
-Examples
---------
- [myconn]
- provider=firebird # Use the kinterbasdb adapter
- host=localhost # The hostname/IP of the Firebird host
- dbname=mydb # The name of the Firebird database
-
- [myconn2]
- provider=interbase # Use the kinterbasdb adapter
- host=localhost # The hostname/IP of the Interbase host
- dbname=mydb # The name of the Interbase database
-
-Notes
------
-1. This driver is fully fuctional and has no serious known problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (DBSIG2.Connection):
- """
- Connection class for Interbase backends using the KinterbasDB DBSIG2 module.
- """
-
- _drivername_ = 'kinterbasdb'
- _behavior_ = Behavior.Behavior
-
- _broken_rowcount_ = True
-
-
- # ---------------------------------------------------------------------------
- # Constructor
- # ---------------------------------------------------------------------------
-
- def __init__ (self, connections, name, parameters):
-
- DBSIG2.Connection.__init__ (self, connections, name, parameters)
-
- # Find out encoding for Interbase
- if ib_encTable.has_key (self._encoding):
- self._ib_encoding = ib_encTable [self._encoding]
- else:
- self._ib_encoding = ''
- gDebug (1, "Encoding '%s' is not supported by interbase dbdriver. "
- "Using default encoding." % self._encoding)
-
-
- # ---------------------------------------------------------------------------
- # Get connection parameters
- # ---------------------------------------------------------------------------
-
- def _getConnectParams_ (self, connectData):
-
- # mandatory parameters
- kwargs = {'database': connectData ['dbname'],
- 'user' : connectData ['_username'],
- 'password': connectData ['_password']}
-
- # optional parameters
- for gnueName, ibName in [('host', 'host')]:
- if connectData.has_key (gnueName):
- kwargs [ibName] = connectData [gnueName]
-
- # character set
- if self._ib_encoding:
- kwargs ['charset'] = self._ib_encoding
-
- return ([], kwargs)
-
-
- # ---------------------------------------------------------------------------
- # Start a new transaction
- # ---------------------------------------------------------------------------
-
- def _beginTransaction_ (self):
- self._native.begin ()
-
-
- # ---------------------------------------------------------------------------
- # Return the current date, according to database
- # ---------------------------------------------------------------------------
-
- def getTimeStamp (self):
- return self.sql1 ("SELECT CAST('now' AS DATE) FROM rdb$database")
-
-
- # ---------------------------------------------------------------------------
- # Return a sequence number from sequence 'name'
- # ---------------------------------------------------------------------------
-
- def getSequence (self, name):
- return self.sql1 ("SELECT gen_id(%s,1) FROM rdb$database" % name)
-
-
-# =============================================================================
-# Encoding-Table
-# =============================================================================
-
-# RDB$CHARACTER_SETS.RDB$CHARACTER_SET_NAME
-ib_encTable = {'ascii' : 'ASCII',
- '' : 'BIG_5',
- '' : 'CYRL',
- 'cp437' : 'DOS437',
- 'cp850' : 'DOS850',
- 'cp852' : 'DOS852',
- 'cp857' : 'DOS857',
- 'cp860' : 'DOS860',
- 'cp861' : 'DOS861',
- 'cp863' : 'DOS863',
- 'cp865' : 'DOS865',
- '' : 'EUCJ_0208',
- '' : 'GB_2312',
- 'iso8859-1' : 'ISO8859_1',
- 'iso8859-2' : 'ISO8859_2',
- 'iso8859-3' : 'ISO8859_3',
- 'iso8859-4' : 'ISO8859_4',
- 'iso8859-5' : 'ISO8859_5',
- 'iso8859-6' : 'ISO8859_6',
- 'iso8859-7' : 'ISO8859_7',
- 'iso8859-8' : 'ISO8859_8',
- 'iso8859-9' : 'ISO8859_9',
- 'iso8859-13': 'ISO8859_13',
- '' : 'KSC_5601',
- '' : 'NEXT',
- '' : 'NONE',
- '' : 'OCTETS',
- '' : 'SJIS_0208',
- 'utf-8' : 'UNICODE_FSS',
- 'cp1250' : 'WIN1250',
- 'cp1251' : 'WIN1251',
- 'cp1252' : 'WIN1252',
- 'cp1253' : 'WIN1253',
- 'cp1254' : 'WIN1254',
- 'cp1255' : 'WIN1255',
- 'cp1256' : 'WIN1256',
- 'cp1257' : 'WIN1257'}
Copied:
trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdbdrv.py (from
rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdb.py)
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdb.py
2005-07-07 07:34:35 UTC (rev 7691)
+++ trunk/gnue-common/src/datasources/drivers/sql/interbase/kinterbasdbdrv.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -0,0 +1,215 @@
+# GNU Enterprise Common Library - Firebird database driver using KinterbasDB
+#
+# Copyright 2000-2005 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+"""
+Database driver plugin for Firebird/Interbase backends using the KinterbasDB
+DBSIG2 module.
+"""
+
+__all__ = ['Connection']
+
+from gnue.common.datasources.drivers import DBSIG2
+from gnue.common.datasources.drivers.sql.interbase import Behavior
+
+
+# =============================================================================
+# Test if plugin is functional
+# =============================================================================
+
+def __initplugin__ ():
+ from gnue.common.datasources import GConnections
+ try:
+ import kinterbasdb
+
+ except ImportError:
+ raise GConnections.DependencyError, ('kinterbasdb', None)
+
+
+# =============================================================================
+# Driver info
+# =============================================================================
+
+class DriverInfo:
+
+ name = "kinterbasdb Firebird/Interbase Driver"
+
+ url = "http://kinterbasdb.sourceforge.net"
+
+ doc = """
+Description
+-----------
+Written by Alexander Kuznetsov, kinterbasdb provides support for
+Firebird and Interbase.
+
+Support
+-------
+Supported Platforms:
+
+ - Linux/BSD
+ - MS Windows 98/NT/2000/XP (Installer available)
+
+
+Connection Properties
+---------------------
+* host -- This is the hostname running your database server (optional)
+* dbname -- This is the name of the database to use (required)
+
+Examples
+--------
+ [myconn]
+ provider=firebird # Use the kinterbasdb adapter
+ host=localhost # The hostname/IP of the Firebird host
+ dbname=mydb # The name of the Firebird database
+
+ [myconn2]
+ provider=interbase # Use the kinterbasdb adapter
+ host=localhost # The hostname/IP of the Interbase host
+ dbname=mydb # The name of the Interbase database
+
+Notes
+-----
+1. This driver is fully fuctional and has no serious known problems.
+"""
+
+
+# =============================================================================
+# Connection class
+# =============================================================================
+
+class Connection (DBSIG2.Connection):
+ """
+ Connection class for Interbase backends using the KinterbasDB DBSIG2 module.
+ """
+
+ _drivername_ = 'kinterbasdb'
+ _behavior_ = Behavior.Behavior
+
+ _broken_rowcount_ = True
+
+
+ # ---------------------------------------------------------------------------
+ # Constructor
+ # ---------------------------------------------------------------------------
+
+ def __init__ (self, connections, name, parameters):
+
+ DBSIG2.Connection.__init__ (self, connections, name, parameters)
+
+ # Find out encoding for Interbase
+ if ib_encTable.has_key (self._encoding):
+ self._ib_encoding = ib_encTable [self._encoding]
+ else:
+ self._ib_encoding = ''
+ gDebug (1, "Encoding '%s' is not supported by interbase dbdriver. "
+ "Using default encoding." % self._encoding)
+
+
+ # ---------------------------------------------------------------------------
+ # Get connection parameters
+ # ---------------------------------------------------------------------------
+
+ def _getConnectParams_ (self, connectData):
+
+ # mandatory parameters
+ kwargs = {'database': connectData ['dbname'],
+ 'user' : connectData ['_username'],
+ 'password': connectData ['_password']}
+
+ # optional parameters
+ for gnueName, ibName in [('host', 'host')]:
+ if connectData.has_key (gnueName):
+ kwargs [ibName] = connectData [gnueName]
+
+ # character set
+ if self._ib_encoding:
+ kwargs ['charset'] = self._ib_encoding
+
+ return ([], kwargs)
+
+
+ # ---------------------------------------------------------------------------
+ # Start a new transaction
+ # ---------------------------------------------------------------------------
+
+ def _beginTransaction_ (self):
+ self._native.begin ()
+
+
+ # ---------------------------------------------------------------------------
+ # Return the current date, according to database
+ # ---------------------------------------------------------------------------
+
+ def getTimeStamp (self):
+ return self.sql1 ("SELECT CAST('now' AS DATE) FROM rdb$database")
+
+
+ # ---------------------------------------------------------------------------
+ # Return a sequence number from sequence 'name'
+ # ---------------------------------------------------------------------------
+
+ def getSequence (self, name):
+ return self.sql1 ("SELECT gen_id(%s,1) FROM rdb$database" % name)
+
+
+# =============================================================================
+# Encoding-Table
+# =============================================================================
+
+# RDB$CHARACTER_SETS.RDB$CHARACTER_SET_NAME
+ib_encTable = {'ascii' : 'ASCII',
+ '' : 'BIG_5',
+ '' : 'CYRL',
+ 'cp437' : 'DOS437',
+ 'cp850' : 'DOS850',
+ 'cp852' : 'DOS852',
+ 'cp857' : 'DOS857',
+ 'cp860' : 'DOS860',
+ 'cp861' : 'DOS861',
+ 'cp863' : 'DOS863',
+ 'cp865' : 'DOS865',
+ '' : 'EUCJ_0208',
+ '' : 'GB_2312',
+ 'iso8859-1' : 'ISO8859_1',
+ 'iso8859-2' : 'ISO8859_2',
+ 'iso8859-3' : 'ISO8859_3',
+ 'iso8859-4' : 'ISO8859_4',
+ 'iso8859-5' : 'ISO8859_5',
+ 'iso8859-6' : 'ISO8859_6',
+ 'iso8859-7' : 'ISO8859_7',
+ 'iso8859-8' : 'ISO8859_8',
+ 'iso8859-9' : 'ISO8859_9',
+ 'iso8859-13': 'ISO8859_13',
+ '' : 'KSC_5601',
+ '' : 'NEXT',
+ '' : 'NONE',
+ '' : 'OCTETS',
+ '' : 'SJIS_0208',
+ 'utf-8' : 'UNICODE_FSS',
+ 'cp1250' : 'WIN1250',
+ 'cp1251' : 'WIN1251',
+ 'cp1252' : 'WIN1252',
+ 'cp1253' : 'WIN1253',
+ 'cp1254' : 'WIN1254',
+ 'cp1255' : 'WIN1255',
+ 'cp1256' : 'WIN1256',
+ 'cp1257' : 'WIN1257'}
Deleted: trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdb.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdb.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdb.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,173 +0,0 @@
-# GNU Enterprise Common Library - MaxDB database driver
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for MaxDB/SAP-DB backends.
-"""
-
-__all__ = ['Connection']
-
-import datetime
-
-from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources.drivers.sql.maxdb import Behavior
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import sapdb.dbapi
-
- except ImportError:
- raise GConnections.DependencyError, ('sapdb', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "MySQL's MaxDB driver"
-
- url = "http://www.mysql.com/products/maxdb/sapdbapi.html"
-
- doc = """
-Description
------------
-Python driver for MaxDB/SAPDB version 7.x+.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - MS Windows 98/NT/2000/XP
-
-Connection Properties
----------------------
-* host -- This is the MaxDB host for your connection (optional)
-* dbname -- This is the MaxDB database to use (required)
-* timeout -- Command timeout in seconds (optional)
-* isolation -- Isolation level (optional) (0, 1 [default], 10, 15, 2, 20, 3,
30)
-* sqlmode -- INTERNAL (default) or ORACLE (optional)
-* sqlsubmode -- ODBC or empty (optional)
-
-Examples
---------
-# This connection uses the SAP DB driver
-# We will be connecting to the SAP DB server on
-# "localhost" to a database called "TST".
-[sapdb]
-comment = XYZ Development Database
-provider = sapdb
-host=dbs.mydomain.com
-dbname = TST
-timeout = 900
-
-Notes
------
-1. The driver is fully functional
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (DBSIG2.Connection):
- """
- Connection class for MaxDB backends.
- """
-
- _drivername_ = 'sapdb.dbapi'
- _behavior_ = Behavior.Behavior
-
- _named_as_sequence_ = True
- _std_datetime_ = True
-
-
- # ---------------------------------------------------------------------------
- # Get connection parameters
- # ---------------------------------------------------------------------------
-
- def _getConnectParams_ (self, connectData):
-
- # mandatory parameters
- # FIXME: would it be possible to use kwargs for these parameters, too?
- params = [(connectData ['_username']).upper(),
- connectData ['_password'],
- connectData ['dbname'],
- connectData.get ('host', '')]
-
- # keyword arguments
- kwargs = {}
-
- for gnueName, sapdbName in [('sqlmode' , 'sqlmode'),
- ('timeout' , 'timeout'),
- ('isolation' , 'isolation'),
- ('sqlsubmode', 'component')]:
- if connectData.has_key (gnueName):
- kwargs [sapdbName] = connectData [gnueName]
-
- return (params, kwargs)
-
- # ---------------------------------------------------------------------------
-
- def _connect_ (self, connectData):
-
- DBSIG2.Connection._connect_ (self, connectData)
- self._native.typeTranslations = {'Date': self.__toDate,
- 'Time': self.__toTime,
- 'Timestamp': self.__toDateTime}
-
- # ---------------------------------------------------------------------------
-
- def __toDate (self, internal):
- (year, month, day) = (internal [:4], internal [4:6], internal [6:8])
- return datetime.date (int (year), int (month), int (day))
-
- # ---------------------------------------------------------------------------
-
- def __toTime (self, internal):
- (hour, minute, second) = map (int, (internal [:4], internal [4:6],
- internal [6:8]))
- return datetime.time (hour, minute, second)
-
- # ---------------------------------------------------------------------------
-
- def __toDateTime (self, ival):
- (year, month, day, hour, minute, second, micros) = \
- map (int, (ival [:4], ival [4:6], ival [6:8], ival [8:10], ival
[10:12],
- ival [12:14], ival [14:] or '0'))
- return datetime.datetime (year, month, day, hour, minute, second, micros)
-
- # ---------------------------------------------------------------------------
-
- def _createTime_ (self, hour, minute, second, msecs = 0):
-
- return self._driver.Time (hour, minute, second)
Copied: trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdbdrv.py (from
rev 7691, trunk/gnue-common/src/datasources/drivers/sql/maxdb/maxdb.py)
Deleted: trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,161 +0,0 @@
-# GNU Enterprise Common Library - MS-ADO database driver using adodbapi
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for MS-ADO backends using the adodbapi DBSIG2 module.
-"""
-
-__all__ = ['Connection']
-
-from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources.drivers.sql.msado import Behavior
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import adodbapi
- except ImportError:
- raise GConnections.DependencyError, ('adodbapi', None)
- try:
- import win32com
- except ImportError:
- raise GConnections.DependencyError, ('win32com', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "adodbapi"
-
- url = "http://sourceforge.net/projects/adodbapi"
-
- doc = """
-Description
------------
-A Python DB-API 2.0 module that makes it easy to use Microsoft ADO
-for connecting with databases and other data sources.
-
-Prerequisites:
-
- * Mark Hammond's win32all python for windows extensions.
-
-
-Support
--------
-Supported Platforms:
-
- - MS Windows 98/NT/2000/XP (Installer available)
-
-
-Connection Properties
-----------------------
-* oledb_provider (required)
-* data_source (required)
-* initial_catalog (optional for SQL Server)
-* network_library (optional for SQL Server)
-* data_provider (optional for SQL Server)
-
-You can find more connection strings here:
- http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm
-
-Examples
---------
- [access]
- comment = MS Access database
- provider = adodbapi
- oledb_provider = Microsoft.Jet.OLEDB.4.0
- data_source = C:\mydb.mdb
-
- [sqlserver]
- comment = MS SQL Server database
- provider = adodbapi
- oledb_provider = sqloledb
- data_source = myServerName
- initial_catalog = myDatabaseName
-
-Notes
------
-1. This driver is only usable under MS Windows.
-
-2. This driver does not implement schema creation. Index introspection is not
- supported by this driver
-
-3. MS SQL Server has been tested successfully. MS Access backends need some
- more testing
-
-4. Other than that, the driver is fully functional with no known serious
- problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (DBSIG2.Connection):
- """
- Connection class for MS ADO backends using the adodbapi DBSIG2 module.
- """
-
- _drivername_ = 'adodbapi'
-
- _broken_rowcount_ = True
-
- _defaultBehavior_ = Behavior.Behavior
-
-
- # ---------------------------------------------------------------------------
- # Build up parameters for connect method
- # ---------------------------------------------------------------------------
-
- def _getConnectParams_ (self, connectData):
-
- import adodbapi
-
- adodbapi.defaultIsolationLevel = adodbapi.adXactSerializable
-
- # mandatory parameters
- params = {'Provider' : connectData ['oledb_provider'],
- 'Data Source': connectData ['data_source'],
- 'User Id' : connectData ['_username'],
- 'Password' : connectData ['_password']}
-
- # optional parameters
- for gnueName, oledbName in [('initial_catalog', 'Initial Catalog'),
- ('network_library', 'Network Library'),
- ('data_provider' , 'Data Provider' )]:
- if connectData.has_key (gnueName):
- params [oledbName] = connectData [gnueName]
-
- p = ["%s=%s" % (k, v) for (k, v) in params.items ()]
- connectstring = ';'.join (p)
-
- return ([connectstring], {})
Copied: trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapidrv.py
(from rev 7692, trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py)
Deleted: trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldb.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldb.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldb.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,161 +0,0 @@
-# GNU Enterprise Common Library - MySQL database driver using MySQLdb
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for MySQL backends using the MySQLdb DBSIG2 module.
-"""
-
-__all__ = ['Connection']
-
-from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources.drivers.sql.mysql import Behavior
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import MySQLdb
- except ImportError:
- raise GConnections.DependencyError ('mysql-python',
- 'http://sourceforge.net/projects/mysql-python')
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "MySQLdb"
-
- url = "http://sourceforge.net/projects/mysql-python"
-
- doc = """
-Description
------------
-Mysql-python, written by Andy Dustman, supports MySQL 3.22, 3.23, and
-4.x.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - Solaris
- - MS Windows 98/NT/2000/XP (Installer available)
-
-Connection Properties
-----------------------
-* host -- This is the host for your connection (required)
-* dbname -- This is the name of the database to use (required)
-* port -- This is the port where the server is running (optional)
-
-Examples
---------
- [myconn]
- provider=mysql # Use the MySQLdb adapter
- host=localhost # The hostname/IP of the MySQL host
- dbname=mydb # The name of the MySQL database
-
-Notes
------
-1. Transactions are supported if MySQL is compiled with proper
- transactional support (3.x series does NOT do this by default!).
-
-2. Windows installer available at http://www.cs.fhm.edu/~ifw00065/.
-
-3. Other than that, the driver is fully functional with no known serious
- problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (DBSIG2.Connection):
- """
- Connection class for MySQL backends using the MySQLdb DBSIG2 module.
- """
-
- _drivername_ = 'MySQLdb'
- _behavior_ = Behavior.Behavior
-
- _boolean_true_ = 1
- _boolean_false_ = 0
- _std_datetime_ = True
-
-
- # ---------------------------------------------------------------------------
- # Get connection parameters
- # ---------------------------------------------------------------------------
-
- def _getConnectParams_ (self, connectData):
-
- # mandatory parameters
- kwargs = {'db' : connectData ['dbname'],
- 'user' : connectData ['_username'],
- 'passwd': connectData ['_password'] or ''}
-
- # optional parameters
- for gnueName, dbName in [('host', 'host'), ('port', 'port'),
- ('encoding', 'unicode')]:
- if gnueName in connectData:
- if gnueName == 'port':
- kwargs [dbName] = int (connectData [gnueName])
- else:
- kwargs [dbName] = connectData [gnueName]
-
- return ([], kwargs)
-
-
- # ---------------------------------------------------------------------------
- # Start a new transaction
- # ---------------------------------------------------------------------------
-
- def _beginTransaction_ (self):
- # only available if MySQL is compiled with transaction support
- try:
- self._native.begin ()
- except:
- pass
-
-
- # ---------------------------------------------------------------------------
- # Return the current date, according to database
- # ---------------------------------------------------------------------------
-
- def getTimeStamp (self):
- return self.sql1 ("select current_timestamp")
-
-
- # ---------------------------------------------------------------------------
- # Return a sequence number from sequence 'name'
- # ---------------------------------------------------------------------------
-
- # def getSequence (self, name):
- # (not available in MySQL)
Copied: trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldbdrv.py (from
rev 7691, trunk/gnue-common/src/datasources/drivers/sql/mysql/mysqldb.py)
Deleted: trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracle.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracle.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracle.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,103 +0,0 @@
-# GNU Enterprise Common Library - Oracle database driver using cxOracle
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for Oracle backends using the cxOracle DBSIG2 module.
-"""
-
-__all__ = ('Connection')
-
-from gnue.common.datasources.drivers.sql.oracle import Base
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import cx_Oracle
- except ImportError:
- raise GConnections.DependencyError, ('cx_Oracle', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "cx_Oracle SQLNet Driver"
-
- url = "http://www.computronix.com/utilities.shtml"
-
- doc = """
-Description
------------
-An Oracle driver from Computronix. Works with Oracle 7.3, 8.x, and 9i via
-Oracle's SQL-Net OCI interface.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - Solaris
- - MS Windows 98/NT/2000/XP (Installer available)
-
-
-Connection Properties
-----------------------
-* service -- This is the Oracle TNS connection name
-
-Examples
---------
-[myconn]
-provider=cxoracle # Use the CX Oracle adapter
-service=mytnsname # The TNS connection string of the database
-
-Notes
------
-1. Requires Oracle Client Libraries.
-
-2. Does not recognize the TWO_TASK environment setting.
-
-3. Creation of new databases with "gnue-schema --createdb" does not
- work with this driver. Index introspection is not supported.
-
-4. Other than that, the driver is fully functional with no known serious
- problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (Base.Connection):
- """
- Connection class for Oracle backends using the cxOracle DBSIG2 module.
- """
-
- _drivername_ = 'cx_Oracle'
Copied: trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracledrv.py
(from rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracle.py)
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracle.py
2005-07-07 07:34:35 UTC (rev 7691)
+++ trunk/gnue-common/src/datasources/drivers/sql/oracle/cxoracledrv.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -0,0 +1,104 @@
+# GNU Enterprise Common Library - Oracle database driver using cxOracle
+#
+# Copyright 2000-2005 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+"""
+Database driver plugin for Oracle backends using the cxOracle DBSIG2 module.
+"""
+
+__all__ = ('Connection')
+__pluginalias__ = ['cxoracle']
+
+from gnue.common.datasources.drivers.sql.oracle import Base
+
+
+# =============================================================================
+# Test if plugin is functional
+# =============================================================================
+
+def __initplugin__ ():
+ from gnue.common.datasources import GConnections
+ try:
+ import cx_Oracle
+ except ImportError:
+ raise GConnections.DependencyError, ('cx_Oracle', None)
+
+
+# =============================================================================
+# Driver info
+# =============================================================================
+
+class DriverInfo:
+
+ name = "cx_Oracle SQLNet Driver"
+
+ url = "http://www.computronix.com/utilities.shtml"
+
+ doc = """
+Description
+-----------
+An Oracle driver from Computronix. Works with Oracle 7.3, 8.x, and 9i via
+Oracle's SQL-Net OCI interface.
+
+Support
+-------
+Supported Platforms:
+
+ - Linux/BSD
+ - Solaris
+ - MS Windows 98/NT/2000/XP (Installer available)
+
+
+Connection Properties
+----------------------
+* service -- This is the Oracle TNS connection name
+
+Examples
+--------
+[myconn]
+provider=cxoracle # Use the CX Oracle adapter
+service=mytnsname # The TNS connection string of the database
+
+Notes
+-----
+1. Requires Oracle Client Libraries.
+
+2. Does not recognize the TWO_TASK environment setting.
+
+3. Creation of new databases with "gnue-schema --createdb" does not
+ work with this driver. Index introspection is not supported.
+
+4. Other than that, the driver is fully functional with no known serious
+ problems.
+"""
+
+
+# =============================================================================
+# Connection class
+# =============================================================================
+
+class Connection (Base.Connection):
+ """
+ Connection class for Oracle backends using the cxOracle DBSIG2 module.
+ """
+
+ _drivername_ = 'cx_Oracle'
Deleted: trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracle.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracle.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracle.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,106 +0,0 @@
-# GNU Enterprise Common Library - Oracle database driver using DCOracle
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for Oracle backends using the DCOracle DBSIG2 module.
-"""
-
-__all__ = ('Connection')
-
-from gnue.common.datasources.drivers.sql.oracle import Base
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import DCOracle2
- except ImportError:
- raise GConnections.DependencyError ('DCOracle2', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "DCOracle2 OCI Driver"
-
- url = "http://www.zope.org/Members/matt/dco2/"
-
- doc = """
-Description
------------
-An Oracle driver from Digital Creations (Zope). Works with Oracle
-7.3, 8.x, 9i via Oracle's SQL-Net OCI interface.
-
-The "Oracle Database Bindings for Python" are packaged with the
-"Zope Oracle Database Adapter". GNUe does not use the Zope
-Adapter, so you can safely ignore any installation instructions
-referring to Zope.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - Solaris
- - MS Windows 98/NT/2000/XP (Installer available)
-
-Connection Properties
-----------------------
-* service -- This is the Oracle TNS connection name
-
-Examples
---------
-provider=oracle # Use the DCOracle2 adapter
-service=mytnsname # The TNS connection string of the database
-
-Notes
------
-1. Requires Oracle Client Libraries.
-
-2. Does not recognize the TWO_TASK environment setting.
-
-3. Creation of new databases with "gnue-schema --createdb" does not
- work with this driver. Index introspection is not supported
-
-4. Other than that, the driver is fully functional with no known serious
- problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (Base.Connection):
- """
- Connection class for Oracle backends using the DCOracle DBSIG2 module.
- """
-
- _drivername_ = 'DCOracle2'
Copied: trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracledrv.py
(from rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracle.py)
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracle.py
2005-07-07 07:34:35 UTC (rev 7691)
+++ trunk/gnue-common/src/datasources/drivers/sql/oracle/dcoracledrv.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -0,0 +1,107 @@
+# GNU Enterprise Common Library - Oracle database driver using DCOracle
+#
+# Copyright 2000-2005 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+"""
+Database driver plugin for Oracle backends using the DCOracle DBSIG2 module.
+"""
+
+__all__ = ('Connection')
+__pluginalias__ = ['dcoracle']
+
+from gnue.common.datasources.drivers.sql.oracle import Base
+
+
+# =============================================================================
+# Test if plugin is functional
+# =============================================================================
+
+def __initplugin__ ():
+ from gnue.common.datasources import GConnections
+ try:
+ import DCOracle2
+ except ImportError:
+ raise GConnections.DependencyError ('DCOracle2', None)
+
+
+# =============================================================================
+# Driver info
+# =============================================================================
+
+class DriverInfo:
+
+ name = "DCOracle2 OCI Driver"
+
+ url = "http://www.zope.org/Members/matt/dco2/"
+
+ doc = """
+Description
+-----------
+An Oracle driver from Digital Creations (Zope). Works with Oracle
+7.3, 8.x, 9i via Oracle's SQL-Net OCI interface.
+
+The "Oracle Database Bindings for Python" are packaged with the
+"Zope Oracle Database Adapter". GNUe does not use the Zope
+Adapter, so you can safely ignore any installation instructions
+referring to Zope.
+
+Support
+-------
+Supported Platforms:
+
+ - Linux/BSD
+ - Solaris
+ - MS Windows 98/NT/2000/XP (Installer available)
+
+Connection Properties
+----------------------
+* service -- This is the Oracle TNS connection name
+
+Examples
+--------
+provider=oracle # Use the DCOracle2 adapter
+service=mytnsname # The TNS connection string of the database
+
+Notes
+-----
+1. Requires Oracle Client Libraries.
+
+2. Does not recognize the TWO_TASK environment setting.
+
+3. Creation of new databases with "gnue-schema --createdb" does not
+ work with this driver. Index introspection is not supported
+
+4. Other than that, the driver is fully functional with no known serious
+ problems.
+"""
+
+
+# =============================================================================
+# Connection class
+# =============================================================================
+
+class Connection (Base.Connection):
+ """
+ Connection class for Oracle backends using the DCOracle DBSIG2 module.
+ """
+
+ _drivername_ = 'DCOracle2'
Deleted: trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopg.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopg.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopg.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,104 +0,0 @@
-# GNU Enterprise Common Library - PostgreSQL database driver using psycopg
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for PostgreSQL backends using the psycopg DBSIG2 module.
-"""
-
-__all__ = ('Connection')
-
-from gnue.common.datasources.drivers.sql.postgresql import Base
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import psycopg
- except:
- raise GConnections.DependencyError, ('psycopg', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "psycopg"
-
- url = "http://initd.org/software/initd/psycopg/"
-
- doc = """
-Description
------------
-From the Psycopg website: "It was written from scratch with the aim of
-being very small and fast, and stable as a rock." Written by initd.org
-volunteers.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - MS Windows 98/NT/2000/XP (Installer available)
-
-Connection Properties
----------------------
-* dbname -- This is the database to use (required)
-* host -- This is the name of the database host, or, on Linux,
- directory containing the network socket (optional)
-* port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
-
-Examples
---------
- [myconn]
- provider=psycopg # Use the psycopg adapter
- host=localhost # The hostname/IP of the postgresql host
- dbname=mydb # The name of the pg database
-
-Notes
------
-1. This is the driver of choice for PostgreSQL.
-
-2. Available in Debian as: "apt-get install python-psycopg".
-
-3. Windows installer available at:
http://stickpeople.com/projects/python/win-psycopg/.
-
-4. This driver is fully functional with no known serious problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (Base.Connection):
- """
- Connection class for PostgreSQL backends using the psycopg DBISG2 module.
- """
-
- _drivername_ = 'psycopg'
Copied: trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopgdrv.py
(from rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopg.py)
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopg.py
2005-07-07 07:34:35 UTC (rev 7691)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/psycopgdrv.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -0,0 +1,105 @@
+# GNU Enterprise Common Library - PostgreSQL database driver using psycopg
+#
+# Copyright 2000-2005 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+"""
+Database driver plugin for PostgreSQL backends using the psycopg DBSIG2 module.
+"""
+
+__all__ = ('Connection')
+__pluginalias__ = ['psycopg']
+
+from gnue.common.datasources.drivers.sql.postgresql import Base
+
+
+# =============================================================================
+# Test if plugin is functional
+# =============================================================================
+
+def __initplugin__ ():
+ from gnue.common.datasources import GConnections
+ try:
+ import psycopg
+ except:
+ raise GConnections.DependencyError, ('psycopg', None)
+
+
+# =============================================================================
+# Driver info
+# =============================================================================
+
+class DriverInfo:
+
+ name = "psycopg"
+
+ url = "http://initd.org/software/initd/psycopg/"
+
+ doc = """
+Description
+-----------
+From the Psycopg website: "It was written from scratch with the aim of
+being very small and fast, and stable as a rock." Written by initd.org
+volunteers.
+
+Support
+-------
+Supported Platforms:
+
+ - Linux/BSD
+ - MS Windows 98/NT/2000/XP (Installer available)
+
+Connection Properties
+---------------------
+* dbname -- This is the database to use (required)
+* host -- This is the name of the database host, or, on Linux,
+ directory containing the network socket (optional)
+* port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
+
+Examples
+--------
+ [myconn]
+ provider=psycopg # Use the psycopg adapter
+ host=localhost # The hostname/IP of the postgresql host
+ dbname=mydb # The name of the pg database
+
+Notes
+-----
+1. This is the driver of choice for PostgreSQL.
+
+2. Available in Debian as: "apt-get install python-psycopg".
+
+3. Windows installer available at:
http://stickpeople.com/projects/python/win-psycopg/.
+
+4. This driver is fully functional with no known serious problems.
+"""
+
+
+# =============================================================================
+# Connection class
+# =============================================================================
+
+class Connection (Base.Connection):
+ """
+ Connection class for PostgreSQL backends using the psycopg DBISG2 module.
+ """
+
+ _drivername_ = 'psycopg'
Deleted: trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresql.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresql.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresql.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,98 +0,0 @@
-# GNU Enterprise Common Library - PostgreSQL database driver using PyGreSQL
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for PostgreSQL backends using the PyGreSQL DBSIG2
-module.
-"""
-
-__all__ = ('Connection')
-
-from gnue.common.datasources.drivers.sql.postgresql import Base
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import pgdb
- except ImportError:
- raise GConnections.DependencyError, ('pygresql', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "PyGreSQL"
-
- url = "http://druid.net/pygresql/"
-
- doc = """
-Description
------------
-PyGreSQL is the PostgreSQL-Python driver available via PostgreSQL's CVS tree.
-It is compliant to Python's DB-API 2.0.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
-
-Connection Properties
----------------------
-* dbname -- This is the database to use (required)
-* host -- This is the name of the database host, or, on Linux,
- directory containing the network socket (optional)
-* port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
-
-Examples
---------
- [myconn]
- provider=pygresql # Use the pygresql adapter
- host=localhost # The hostname/IP of the postgresql host
- dbname=mydb # The name of the pg database
-
-Notes
------
-1. The developers of GNUe have had mixed results with the PygreSQL driver
- and generally recommend one of the others.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (Base.Connection):
- """
- Connection class for PostgreSQL backends using the PyGreSQL DBSIG2 module.
- """
-
- _drivername_ = 'pgdb'
Copied: trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresqldrv.py
(from rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresql.py)
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresql.py
2005-07-07 07:34:35 UTC (rev 7691)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/pygresqldrv.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -0,0 +1,99 @@
+# GNU Enterprise Common Library - PostgreSQL database driver using PyGreSQL
+#
+# Copyright 2000-2005 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+"""
+Database driver plugin for PostgreSQL backends using the PyGreSQL DBSIG2
+module.
+"""
+
+__all__ = ('Connection')
+__pluginalias__ = ['pygresql']
+
+from gnue.common.datasources.drivers.sql.postgresql import Base
+
+
+# =============================================================================
+# Test if plugin is functional
+# =============================================================================
+
+def __initplugin__ ():
+ from gnue.common.datasources import GConnections
+ try:
+ import pgdb
+ except ImportError:
+ raise GConnections.DependencyError, ('pygresql', None)
+
+
+# =============================================================================
+# Driver info
+# =============================================================================
+
+class DriverInfo:
+
+ name = "PyGreSQL"
+
+ url = "http://druid.net/pygresql/"
+
+ doc = """
+Description
+-----------
+PyGreSQL is the PostgreSQL-Python driver available via PostgreSQL's CVS tree.
+It is compliant to Python's DB-API 2.0.
+
+Support
+-------
+Supported Platforms:
+
+ - Linux/BSD
+
+Connection Properties
+---------------------
+* dbname -- This is the database to use (required)
+* host -- This is the name of the database host, or, on Linux,
+ directory containing the network socket (optional)
+* port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
+
+Examples
+--------
+ [myconn]
+ provider=pygresql # Use the pygresql adapter
+ host=localhost # The hostname/IP of the postgresql host
+ dbname=mydb # The name of the pg database
+
+Notes
+-----
+1. The developers of GNUe have had mixed results with the PygreSQL driver
+ and generally recommend one of the others.
+"""
+
+
+# =============================================================================
+# Connection class
+# =============================================================================
+
+class Connection (Base.Connection):
+ """
+ Connection class for PostgreSQL backends using the PyGreSQL DBSIG2 module.
+ """
+
+ _drivername_ = 'pgdb'
Deleted: trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsql.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsql.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsql.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,106 +0,0 @@
-# GNU Enterprise Common Library - PostgreSQL database driver using pyPgSQL
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for PostgreSQL backends using the pyPgSQL DBSIG2 module.
-"""
-
-__all__ = ('Connection')
-
-from gnue.common.datasources.drivers.sql.postgresql import Base
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- from pyPgSQL import PgSQL
- except:
- raise GConnections.DependencyError, ('pyPgSQL', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "pyPgSQL"
-
- url = "http://pypgsql.sf.net/"
-
- doc = """
-Description
------------
-Written by Billy Allie, pyPgSQL is a database interface for PostgreSQL 7.x.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - MS Windows 98/NT/2000/XP (Installer available)
-
-Platforms Tested:
-
- - GNU/Linux [Debian 2.x, 3.x, Slackware 8.0, RedHat ]
- - Windows 98/2000/XP
-
-Connection Properties
----------------------
-* dbname -- This is the database to use (required)
-* host -- This is the name of the database host, or, on Linux,
- directory containing the network socket (optional)
-* port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
-
-Examples
---------
- [myconn]
- provider=pypgsql # Use the pypgsql adapter
- host=localhost # The hostname/IP of the postgresql host
- dbname=mydb # The name of the pg database
-
-Notes
------
-1. pyPgSQL is available in Debian as python-pgsql.
-
-2. This driver is fully functional with no known serious problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (Base.Connection):
- """
- Connection class for PostgreSQL backends using the pyPgSQL DBSIG2 module.
- """
-
- _drivername_ = 'pyPgSQL.PgSQL'
- _rowidField_ = None # PyPgSQL doesn't support rowid's!!
- _broken_fetchmany_ = True
- _broken_rowcount_ = True
Copied: trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsqldrv.py
(from rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsql.py)
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsql.py
2005-07-07 07:34:35 UTC (rev 7691)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/pypgsqldrv.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -0,0 +1,107 @@
+# GNU Enterprise Common Library - PostgreSQL database driver using pyPgSQL
+#
+# Copyright 2000-2005 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+"""
+Database driver plugin for PostgreSQL backends using the pyPgSQL DBSIG2 module.
+"""
+
+__all__ = ('Connection')
+__pluginalias__ = ['pypgsql']
+
+from gnue.common.datasources.drivers.sql.postgresql import Base
+
+
+# =============================================================================
+# Test if plugin is functional
+# =============================================================================
+
+def __initplugin__ ():
+ from gnue.common.datasources import GConnections
+ try:
+ from pyPgSQL import PgSQL
+ except:
+ raise GConnections.DependencyError, ('pyPgSQL', None)
+
+
+# =============================================================================
+# Driver info
+# =============================================================================
+
+class DriverInfo:
+
+ name = "pyPgSQL"
+
+ url = "http://pypgsql.sf.net/"
+
+ doc = """
+Description
+-----------
+Written by Billy Allie, pyPgSQL is a database interface for PostgreSQL 7.x.
+
+Support
+-------
+Supported Platforms:
+
+ - Linux/BSD
+ - MS Windows 98/NT/2000/XP (Installer available)
+
+Platforms Tested:
+
+ - GNU/Linux [Debian 2.x, 3.x, Slackware 8.0, RedHat ]
+ - Windows 98/2000/XP
+
+Connection Properties
+---------------------
+* dbname -- This is the database to use (required)
+* host -- This is the name of the database host, or, on Linux,
+ directory containing the network socket (optional)
+* port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
+
+Examples
+--------
+ [myconn]
+ provider=pypgsql # Use the pypgsql adapter
+ host=localhost # The hostname/IP of the postgresql host
+ dbname=mydb # The name of the pg database
+
+Notes
+-----
+1. pyPgSQL is available in Debian as python-pgsql.
+
+2. This driver is fully functional with no known serious problems.
+"""
+
+
+# =============================================================================
+# Connection class
+# =============================================================================
+
+class Connection (Base.Connection):
+ """
+ Connection class for PostgreSQL backends using the pyPgSQL DBSIG2 module.
+ """
+
+ _drivername_ = 'pyPgSQL.PgSQL'
+ _rowidField_ = None # PyPgSQL doesn't support rowid's!!
+ _broken_fetchmany_ = True
+ _broken_rowcount_ = True
Deleted: trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlite.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlite.py
2005-07-07 11:45:34 UTC (rev 7694)
+++ trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlite.py
2005-07-07 11:46:55 UTC (rev 7695)
@@ -1,169 +0,0 @@
-# GNU Enterprise Common Library - SQLite database driver using pysqlite
-#
-# Copyright 2000-2005 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-"""
-Database driver plugin for SQLite backends using the pysqlite DBSIG2 module.
-"""
-
-__all__ = ['Connection']
-
-from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources.drivers.sql.sqlite import Behavior
-
-
-# =============================================================================
-# Test if plugin is functional
-# =============================================================================
-
-def __initplugin__ ():
- from gnue.common.datasources import GConnections
- try:
- import sqlite
-
- # This is a workaround for a bug in PySQLite. All the following mebers are
- # not imported from main.py in __init__.py
- if not hasattr (sqlite, 'Timestamp') and sqlite.main.have_datetime:
- sqlite.Date = sqlite.main.Date
- sqlite.Time = sqlite.main.Time
- sqlite.Timestamp = sqlite.main.Timestamp
- sqlite.DateFromTicks = sqlite.main.DateFromTicks
- sqlite.TimeFromTicks = sqlite.main.TimeFromTicks
- sqlite.TimestampFromTicks = sqlite.main.TimestampFromTicks
-
- sqlite.DateTimeType = sqlite.main.DateTimeType
- sqlite.DateTimeDeltaType = sqlite.main.DateTimeDeltaType
-
- except ImportError:
- raise GConnections.DependencyError, ('SQLitedbapi', None)
-
-
-# =============================================================================
-# Driver info
-# =============================================================================
-
-class DriverInfo:
-
- name = "pysqlite"
-
- url = "http://pysqlite.sourceforge.net/"
-
- doc = """
-Description
------------
-PySQLite is a Python extension for SQLite that conforms to the Python
-Database API Specification 2.0. The source is released under the
-Python license.
-
-Support
--------
-Supported Platforms:
-
- - Linux/BSD
- - Solaris
- - MS Windows 98/NT/2000/XP
-
-Connection Properties
----------------------
-* dbname -- This is the file name of the sqlite database (required)
-
-Examples
---------
-[myconn]
-provider=sqlite # Use the SQLite adapter
-dbname=/usr/db/testdb # The filename for the SQLite database
-
-Notes
------
-1. The database engine stores all data in string format. Many
- SQL statements won't work. Comparison of date types won't work
- correctly, etc.
-
-2. Other than that, this driver is fully functional without any serious
- known problems.
-"""
-
-
-# =============================================================================
-# Connection class
-# =============================================================================
-
-class Connection (DBSIG2.Connection):
- """
- Connection class for SQLite backends using the pysqlite DBSIG2 module.
- """
-
- _drivername_ = 'sqlite'
- _behavior_ = Behavior.Behavior
-
- # SQLite doesn't like boolean type in SQL parameters
- _boolean_true_ = 1
- _boolean_false_ = 0
-
-
- # ---------------------------------------------------------------------------
- # Constructor
- # ---------------------------------------------------------------------------
-
- def __init__ (self, connections, name, parameters):
-
- DBSIG2.Connection.__init__ (self, connections, name, parameters)
- # FIXME: what was the problem with transactions? Comment should go here.
- self.__noTransactions = parameters.get ('appserver', False)
-
-
- # ---------------------------------------------------------------------------
- # Return a sequence of required login fields
- # ---------------------------------------------------------------------------
-
- def _getLoginFields_ (self):
- """
- This function returns an empty sequence since SQLite doesn't use any user
- authentication.
- """
- return []
-
-
- # ---------------------------------------------------------------------------
- # Get connection parameters
- # ---------------------------------------------------------------------------
-
- def _getConnectParams_ (self, connectData):
-
- # mandatory parameters
- kwargs = {'db' : connectData ['dbname'],
- 'encoding' : self._encoding,
- 'autocommit': self.__noTransactions}
-
- return ([], kwargs)
-
-
- # ---------------------------------------------------------------------------
- # Commit a pending transactiona pending transaction
- # ---------------------------------------------------------------------------
-
- def _commit_ (self):
- """
- This function performs a commit depending on the current transaction-flag.
- """
- if not self.__noTransactions:
- DBSIG2.Connection._commit_ (self)
Copied: trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlitedrv.py
(from rev 7691,
trunk/gnue-common/src/datasources/drivers/sql/sqlite/pysqlite.py)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7695 - in trunk/gnue-common/src/datasources/drivers/sql: interbase maxdb msado mysql oracle postgresql sqlite,
johannes <=