Skip to content
Snippets Groups Projects
Verified Commit 580bfcbd authored by David Beniamine's avatar David Beniamine
Browse files

Monetdb connection test

parent 2bdfae88
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import pymonetdb
# set up a connection. arguments below are the defaults
connection = pymonetdb.connect(username="monetdb", password="monetdb",
hostname="localDB", database="db")
# create a cursor
cursor = connection.cursor()
# increase the rows fetched to increase performance (optional)
cursor.arraysize = 100
# execute a query (return the number of rows to fetch)
res=cursor.execute('SELECT * FROM tables')
if (res > 0):
print('Successfully connected to localDB with default credentials, please change the monetdb password by running docker-compose exec localDB -d monetdb-r /root/set-monetdb-password.sh <password>')
```
%% Output
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-72adc0183b67> in <module>
----> 1 import pymonetdb
2
3 # set up a connection. arguments below are the defaults
4 connection = pymonetdb.connect(username="monetdb", password="monetdb",
5 hostname="localDB", database="monetdb")
ModuleNotFoundError: No module named 'pymonetdb'
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment