- Wrapper Class around Psycopg2 for PostgreSQL
In psycopg2 after connecting to the database, for every read execute statement the data needs to be fetched and for evey write execute statement the data needs to be committed. But this class eliminates these requirements and make it simple to read and write to the database.
- Files:
palpg/__init__.py
- Usage Examples:
import sqlite3
db = palsql.db(“db-filename”) ##-connect to the database
db.read(“sql statement”) ##-returns the read data from database with flat=True
db.read(“select item from table”, flat=False) ##-returns the raw read data
db.read(“select item from table where item = %s”, (sub1,)) ##-read with string substitution
db.read1(“sql statement”) ##-returns the first read data similar to fetchone
db.write(“sql statement”) ##-writes the data and commits to the database
- For other psycopg connection commands use the connection class
db.conn….
Metadata
Release files for palsql 1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| palsql-1.tar.gz | 1.6 kB | Details |
Release files / palsql-1.tar.gz
| Download URL | palsql-1.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bac9af15e6091f7eb39f28ea35bd9374eca9ff41c12603c44e4dceaa32e19cc3
|
|
BLAKE2b-256 checksum How to use checksums |
d6bc1cf380769b1fd8083b6db7b00f3de0ac0e8c3c475f4a1a6e0ffc005116d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|