Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# A simple Jupyter kernel for PostgreSQL

Install with `pip install postgres_kernel`
Install the official version with `pip install postgres_kernel`

Install from git repo (experimental) with: `pip install git+https://github.com/mhoangvslev/postgres_kernel/`

To use, run one of:

Expand Down Expand Up @@ -28,6 +30,12 @@ This is heavily based on [takluyver/bash_kernel](https://github.com/takluyver/ba

![](images/notebook.png)

## Demonstration:
- [Loiret Photographs Archive](https://github.com/mhoangvslev/PhotographiesArchiveSQL)
- [PostgreSQL Basics](https://github.com/mhoangvslev/JupyterPostgreSQLBasics)

## Progress:
[![Waffle.io - Issues in progress](https://badge.waffle.io/mhoangvslev/postgres_kernel.png?label=in%20progress&title=In%20Progress)](http://waffle.io/mhoangvslev/postgres_kernel)

Related
-------
Expand Down
8 changes: 5 additions & 3 deletions postgres_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ def do_execute(self, code, silent, store_history=True,
self.send_response(self.iopub_socket, 'stream',
{'name': 'stderr', 'text': str(e)})
self._conn.rollback()
return {'status': 'error', 'execution_count': self.execution_count,
'ename': 'ProgrammingError', 'evalue': str(e),
'traceback': []}
return {'status': 'abort', 'execution_count': self.execution_count}

else:

if rows is not None:
self.send_response(
self.iopub_socket, 'stream', {
Expand All @@ -210,6 +210,8 @@ def do_execute(self, code, silent, store_history=True,
if header is not None and len(rows) > 0:
self.send_response(self.iopub_socket, 'display_data', display_data(header, rows))

self._conn.commit()

return {'status': 'ok', 'execution_count': self.execution_count,
'payload': [], 'user_expressions': {}}

Expand Down