You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
squares = [(i, i * i) for i in range(100)]
values = ",".join([f"({x}, {y})" for (x, y) in squares])
cursor.execute(f"INSERT INTO squares VALUES {values}")
Is this supposed to be the future method?
Is it currently possible to pass the values with the parameters argument? If so, how would that look like (for multiple simultaneous records to be added)? cursor.executemany(...)?
I would expect less vulnerability to SQL injection and the benefit of automatic type conversion from that functionality.
Hello,
there is an example file showing an INSERT INTO via cursor.execute and concatenation the values via f string.
https://github.com/databricks/databricks-sql-python/blob/main/examples/insert_data.py
Is this supposed to be the future method?
Is it currently possible to pass the values with the parameters argument? If so, how would that look like (for multiple simultaneous records to be added)? cursor.executemany(...)?
I would expect less vulnerability to SQL injection and the benefit of automatic type conversion from that functionality.