Skip to content

Commit

Permalink
Merge pull request #29 from qnngroup/fix-db-log
Browse files Browse the repository at this point in the history
Fix db log
  • Loading branch information
omedeiro authored Oct 9, 2024
2 parents 20d7794 + 0e0178e commit 67ea8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = "pdm.backend"

[project]
name = "qnnpy"
version = "0.1.15"
version = "0.1.16"

authors = [
{ name="O. Medeiros", email="omedeiro@mit.edu" },
Expand Down
8 changes: 4 additions & 4 deletions src/qnnpy/functions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,14 @@ def database_connection(**kwargs) -> Connection:

def log_data_to_database(table_name: str, connection=None, **kwargs):
if connection is None:
conn = database_connection()
cur = conn.cursor()
connection = database_connection()
cur = connection.cursor()
column_names = "`" + "`, `".join(kwargs.keys()) + "`"
values = "'" + "', '".join([str(v) for v in kwargs.values()]) + "'"
command = "INSERT INTO `%s` (%s) VALUES (%s)" % (table_name, column_names, values)
cur.execute(command)
conn.commit()
conn.close()
connection.commit()
connection.close()


def update_table(
Expand Down

0 comments on commit 67ea8a6

Please sign in to comment.