Skip to content

Commit f3df0d6

Browse files
committed
update
1 parent 2d98b45 commit f3df0d6

14 files changed

+480
-1
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.linting.mypyEnabled": false
3+
}

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.0.1
2+
3+
项目创建,原样复刻了[postgres_kernel](https://github.com/bgschiller/postgres_kernel)的功能

MANIFEST.in

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include LICENSE
2+
include README.md
3+
include CHANGELOG.md
4+
include requirements.txt
5+
include postgresql_kernel/kernel.json
6+
recursive-include postgresql_kernel *.pyx *.pxd *.pxi *.py *.c *.h *.temp *.jinja
7+
prune .git
8+
prune docs/build
9+
prune dist
10+
prune build

README.md

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
# postgresql_kernel
2-
连接pg的jupyter内核
2+
3+
+ author: hsz12
4+
+ author-email: [email protected]
5+
6+
keywords: jupyter,jupyter-kernel,postgresql,sql
7+
8+
本项目fork自[postgres_kernel](https://github.com/bgschiller/postgres_kernel).由于这个项目已经快4年每更新过了而我自己常用它,但它又有一些不好用的地方所以才有了现在这个项目.
9+
10+
## 特性
11+
12+
+ 输入sql语言获得表格结果
13+
+ 可选的自动提交
14+
+ 不再需要设置环境变量`DATABASE_URL`
15+
+ jupyter console中可以退出.
16+
17+
## TODO
18+
19+
1. 加入常用可视化功能
20+
2. 改用魔术命令配置连接信息
21+
22+
<!-- ## 安装
23+
24+
`pip install postgresql_kernel` -->
25+
26+
## 使用
27+
28+
1. 连接设置
29+
30+
```sql
31+
-- connection: postgres://postgres:postgres@localhost:5432/postgres
32+
-- autocommit: true
33+
-- (or false)
34+
```
35+
36+
2. 输入sql获得结果
37+
-- connection: postgres://postgres:postgres@localhost:5433/postgres

pip.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[global]
2+
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

pmfprc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"env": "venv"
3+
}

postgresql_kernel/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""An PG kernel for Jupyter"""
2+
3+
__version__ = '0.0.1'
4+
5+
from .kernel import PostgreSQLKernel
6+
7+
__all__ = ["PostgreSQLKernel"]

postgresql_kernel/__main__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .kernel import PostgreSQLKernel
2+
3+
if __name__ == '__main__':
4+
PostgreSQLKernel.run_as_main()

postgresql_kernel/kernel.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"argv": ["python",
3+
"-m", "postgresql_kernel",
4+
"-f", "{connection_file}"],
5+
"display_name": "PostgreSQL",
6+
"mimetype": "text/x-sql",
7+
"language": "sql",
8+
"name": "postgresql"
9+
}

0 commit comments

Comments
 (0)