diff --git a/dashboards/MonetDB.ipynb b/dashboards/MonetDB.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..0688c4b9cf6fdd626dc85634e93e1148598c2106 --- /dev/null +++ b/dashboards/MonetDB.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'pymonetdb'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m<ipython-input-1-72adc0183b67>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mpymonetdb\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m# set up a connection. arguments below are the defaults\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m connection = pymonetdb.connect(username=\"monetdb\", password=\"monetdb\",\n\u001b[1;32m 5\u001b[0m hostname=\"localDB\", database=\"monetdb\")\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pymonetdb'" + ] + } + ], + "source": [ + "import pymonetdb\n", + "\n", + "# set up a connection. arguments below are the defaults\n", + "connection = pymonetdb.connect(username=\"monetdb\", password=\"monetdb\",\n", + " hostname=\"localDB\", database=\"db\")\n", + "\n", + "# create a cursor\n", + "cursor = connection.cursor()\n", + "\n", + "# increase the rows fetched to increase performance (optional)\n", + "cursor.arraysize = 100\n", + "\n", + "# execute a query (return the number of rows to fetch)\n", + "res=cursor.execute('SELECT * FROM tables')\n", + "\n", + "if (res > 0):\n", + " 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>')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}