-
Notifications
You must be signed in to change notification settings - Fork 1
Builder Insert
Miku edited this page Mar 17, 2023
·
4 revisions
Insert data into the database
conn.table("myTable").insert()
-
set(column: str, value: Union[str, int, None])
- set the data of a specific column -
ignore()
- insiert or ignore -
table_set(self, table: str, column: str, value: Union[str, int, None])
- set data in another table -
add_join_table(self, table: str)
- only requierd if you use set json and want to set it in a other table. -
set_json(self, json: Dict[str, any], pop: List[str] = None)
- set data with a json
execute()
get_sql()
# normal insert
connection.table("myTable").insert().set("id", 10).set("age", 25).set("Name", "Helgo").execute()
# insert ignore
connection.table("myTable").insert().set("id", 10).ignore().execute()