Commit 186174d1 authored by Francois Mares's avatar Francois Mares
Browse files

Upload New File

parent 9aec3881
import psycopg2
from SQL import SQL
class Admin(SQL):
def __init__(self,HOST=None, DATABASE=None, PASSWORD=None, USER=None):
super().__init__(HOST, DATABASE, PASSWORD, USER)
# PROTECTED
def _creation_bdd(self):
try :
connexion = self._connexion()
cur = connexion.cursor()
cur.execute(open("../SQL/TABLE.sql", "r").read())
connexion.commit()
return
except psycopg2.Error as e:
print("Message système :", e)
def _insertions_bdd(self):
try :
connexion = self._connexion()
cur = connexion.cursor()
cur.execute(open("../SQL/DATA.sql", "r").read())
connexion.commit()
return
except psycopg2.Error as e:
print("Message système :", e)
def _suppression_bdd(self):
try :
connexion = self._connexion()
cur = connexion.cursor()
cur.execute(open("../SQL/DELETE.sql", "r").read())
connexion.commit()
return
except psycopg2.Error as e:
print("Message système :", e)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment