Placeholder names in `insert_values` and unamed placeholders
The following is not working:
from uuid import UUID
from querybuilder.schemas.helper import table
from querybuilder.drivers.sqlite.connector import Connector
db = Connector(":memory:") # The ":memory:" here is SQLite-specific.
@table
class Person:
id : int # TODO change for UUID here
name : str
birth_year : int
db.execute(Person.create())
db.execute(Person.insert_values(in_columns=(Person.c._[["name", "birth_year"]]), values= [("Dijkstra", 1930), ("Euler", 1707), ("Steiner", 1796)]))
The error is related to the Connector:
ProgrammingError: Binding 1 has no name, but you supplied a dictionary (which has only names).
We should never allow placeholder to not have name. The following should raise:
from querybuilder.queries.algebra.columns import Placeholder
Placeholder(int)
The documentation actually state it is mandatory to give a key, the type says Optional and indeed it is optional.
Edited by PAPERMAN Charles