Yet another PostgreSQL database driver
Project description
Yet another Python PostgreSQL database driver
Requirements
Python 2.7, 3.3+
Installation
Install as a package
$ pip install minipg
Install as a module
$ cd $(PROJECT_HOME) $ wget https://github.com/nakagami/minipg/raw/master/minipg/minipg.py
Example
Query:
import minipg conn = minipg.connect(host='localhost', user='postgres', password='secret', database='database_name') cur = conn.cursor() cur.execute('select foo, bar from baz') for r in cur.fetchall(): print(r[0], r[1]) conn.close()
COPY TO:
import minipg conn = minipg.connect(host='localhost', user='postgres', password='secret', database='database_name') f = open('foo.txt', 'bw') conn.execute('COPY foo_table TO stdout', f) f.close() conn.close()
COPY FROM:
import minipg conn = minipg.connect(host='localhost', user='postgres', password='secret', database='database_name') f = open('foo.txt', 'br') conn.execute('COPY foo_table FROM stdin', f) f.close() conn.close()
Restrictions and Unsupported Features
Authentication METHOD only can ‘trust’ or ‘md5’ in pg_hba.conf.
Not full support for array data types.
Not support for prepared statements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minipg-0.4.0.tar.gz
(128.7 kB
view details)
File details
Details for the file minipg-0.4.0.tar.gz
.
File metadata
- Download URL: minipg-0.4.0.tar.gz
- Upload date:
- Size: 128.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
dd6041f3c017e2f6f8b4ce2e433ebce191e9bb3ce311f8b1fb6ab735331edf81
|
|
MD5 |
e083f64e93865a91fd901709602af3e1
|
|
BLAKE2b-256 |
31fa7fa2b746c920c32bdbce4086acb0140e9283e42b73279bc84738d957c268
|