kiafumi/lib/database.py
Lux Aliaga b2297efcdb lib: database: Initial database support
This commit implements basic support for PostgreSQL databases. It can:
- Connect to a database
- Summon a cursor
Further functionality will be worked on soon
2022-03-09 02:27:30 -03:00

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