Update of /cvsroot/monetdb/clients/src/python/Cimpl/MonetSQLdb
In directory
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14987/src/python/Cimpl/MonetSQLdb
Modified Files:
__init__.py
Log Message:
propagated changes of Wednesday Oct 17 2007 - Monday Oct 22 2007
from the Clients_1-20 branch to the development trunk
Index: __init__.py
===================================================================
RCS file: /cvsroot/monetdb/clients/src/python/Cimpl/MonetSQLdb/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- __init__.py 26 Apr 2007 09:27:59 -0000 1.3
+++ __init__.py 22 Oct 2007 10:35:51 -0000 1.4
@@ -42,7 +42,12 @@
paramstyle = "pyformat"
-from CMapi import *
+try:
+ from MonetDB.CMapi import *
+except ImportError:
+ # if run from the build directory, CMapi is not in the MonetDB module
+ from CMapi import *
+
from monetexceptions import *
import cursors, converters
@@ -73,7 +78,7 @@
class Connection:
- """ Create a connection to the Monet database.
+ """ Create a connection to the MonetDB database.
Parameters to pass to the constructor:
host -- string, host to connect
@@ -83,6 +88,11 @@
lang -- string, language (default SQL)
unicode -- boolean
cursorclass -- the class of the cursor to use
+
+ or to create an embedded MonetDB database
+
+ dbfarm -- string, dbfarm location
+ dbname -- string, database name
"""
_mapi = None
@@ -101,6 +111,7 @@
if not kwargs.has_key('password'): kwargs['password'] = 'monetdb'
else:
if not kwargs.has_key('dbname'): kwargs['dbname'] = 'demo'
+ if not kwargs.has_key('version'): kwargs['version'] = 5
if not kwargs.has_key('lang'): kwargs['lang'] = 'sql'
self.lang = kwargs['lang']
@@ -118,7 +129,7 @@
if not kwargs.has_key('dbfarm'):
self._mapi = Mapi(kwargs['host'], kwargs['port'], kwargs['user'],
kwargs['password'], kwargs['lang'])
else:
- self._mapi = Embedded(kwargs['dbfarm'], kwargs['dbname'],
kwargs['lang'])
+ self._mapi = Embedded(kwargs['dbfarm'], kwargs['dbname'],
kwargs['lang'], kwargs['version'])
def close(self):
del self._mapi
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins