insert helpers
from querybuilder.schemas.helper import table
@table
class Person:
id : int
name : str
age : int
The following methods wrapping Person.insert
(Table.insert) will be very helpful:
-
Table.insert_many(in_columns: Tuple[qbcolumns.Named, ...])
to avoid the following code:
q = Person.insert((Person.columns.name, Person.columns.age), Values(((Placeholder(str, "name"), Placeholder(int, "age")),)))
Which generate the query
Insert: INSERT INTO Person (name, age) VALUES (:name, :age)
- Decoupled
Table.insert
so that it doesn't introspect the query into a list of tuple and introduce:Table.insert_values([("Smith",), ("Dupont",)], in_columns(Person.name,))