Lux Aliaga
b2297efcdb
This commit implements basic support for PostgreSQL databases. It can: - Connect to a database - Summon a cursor Further functionality will be worked on soon
19 lines
381 B
Python
19 lines
381 B
Python
import psycopg2
|
|
|
|
class Database:
|
|
def __init__(self, db, user, password, host, port, init):
|
|
if host == 0:
|
|
host = "localhost"
|
|
|
|
if port == 0:
|
|
port = 5432
|
|
|
|
__conn = psycopg.connect(dbname=db, user=user, password=password, host=host, port=port)
|
|
cur = __conn.cursor
|
|
|
|
def write():
|
|
pass
|
|
|
|
def read():
|
|
pass
|