libsql-experimental-python icon indicating copy to clipboard operation
libsql-experimental-python copied to clipboard

Support named parameters with dictionary of values

Open CodingDoug opened this issue 10 months ago • 0 comments

In sqlite3, these work the way you would expect with each variety of named parameter using a dictionary to specify values:

cur.execute("INSERT INTO users VALUES (:id, :email)", {"id": 2, "email": '[email protected]'})
cur.execute("INSERT INTO users VALUES (@id, @email)", {"id": 3, "email": '[email protected]'})
cur.execute("INSERT INTO users VALUES ($id, $email)", {"id": 4, "email": '[email protected]'})

However, in libsql, these yield the following error:

TypeError: argument 'parameters': 'dict' object cannot be converted to 'PyTuple'

CodingDoug avatar Aug 28 '23 13:08 CodingDoug