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
This commit is contained in:
parent
b2fac1129e
commit
b2297efcdb
|
@ -0,0 +1,18 @@
|
|||
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
|
Loading…
Reference in New Issue