py_experimenter icon indicating copy to clipboard operation
py_experimenter copied to clipboard

Feature Request: Logging Syntax

Open LukasFehring opened this issue 1 year ago • 0 comments

  • PyExperimenter version: Any
  • Database provider: Any
  • Python version: Any
  • Operating System: Any

Description

We currently do not support writing multiple logtable entries at once. Therefore, the only way to do so is by calling the logger multiple times in a row. However MySQL supports logging multiple entries at once.

sql = """
INSERT INTO your_table_name (column1, column2, column3)
VALUES (%s, %s, %s), (%s, %s, %s), (%s, %s, %s)
"""
# Data tuples for insertion
data = (
   'value1a', 'value2a', 'value3a',
   'value1b', 'value2b', 'value3b',
   'value1c', 'value2c', 'value3c'
)
# Execute the SQL command
cursor.execute(sql, data)

We should therefore also allow this.

LukasFehring avatar Apr 18 '24 16:04 LukasFehring