ok
This commit is contained in:
@@ -85,6 +85,7 @@ def reset_data_monetdb(connection,cursor):
|
|||||||
cursor.execute("DROP TABLE IF EXISTS airlines")
|
cursor.execute("DROP TABLE IF EXISTS airlines")
|
||||||
cursor.execute("DROP TABLE IF EXISTS airports")
|
cursor.execute("DROP TABLE IF EXISTS airports")
|
||||||
cursor.execute("DROP TABLE IF EXISTS flights")
|
cursor.execute("DROP TABLE IF EXISTS flights")
|
||||||
|
connection.commit()
|
||||||
|
|
||||||
def disconnect_monetdb(connection,cursor):
|
def disconnect_monetdb(connection,cursor):
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
15
main.py
15
main.py
@@ -23,6 +23,14 @@ requeteDeletePostgreSQL = """DELETE FROM flights WHERE "DAY" > 10"""
|
|||||||
requeteInsertPostgreSQL = """INSERT INTO flights SELECT * FROM flights10"""
|
requeteInsertPostgreSQL = """INSERT INTO flights SELECT * FROM flights10"""
|
||||||
|
|
||||||
|
|
||||||
|
def display_table(data, headers):
|
||||||
|
max_len = max(len(header) for header in headers)
|
||||||
|
print(" | ".join(header.ljust(max_len) for header in headers))
|
||||||
|
sep = "-" * max_len
|
||||||
|
print("-|-".join(sep for _ in headers))
|
||||||
|
for row in data:
|
||||||
|
print(" | ".join(header.ljust(max_len) for header in row))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
#PostgreSQL
|
#PostgreSQL
|
||||||
#create_tables_postgres()
|
#create_tables_postgres()
|
||||||
@@ -31,7 +39,8 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
#MonetDB
|
#MonetDB
|
||||||
conn, cursor =connect_monetdb()
|
conn, cursor =connect_monetdb()
|
||||||
create_table_monetdb(conn,cursor)
|
#reset_data_monetdb(conn,cursor)
|
||||||
#create_data_monetdb(conn,cursor)
|
#create_table_monetdb(conn,cursor)
|
||||||
|
create_data_monetdb(conn,cursor)
|
||||||
#requete_monetdb(conn,cursor, str)
|
#requete_monetdb(conn,cursor, str)
|
||||||
#disconnect_monetdb(conn, cursor)
|
disconnect_monetdb(conn, cursor)
|
||||||
|
|||||||
Reference in New Issue
Block a user