-
Notifications
You must be signed in to change notification settings - Fork 1
Builder Delete
Miku edited this page Mar 17, 2023
·
3 revisions
Delete data from the database
conn.table("myTable").delete()
- all of conditions builder
- im_sure_im_not_use_conditions() - security so that you do not unknowingly delete everything
execute()
get_sql()
# delete with where
connection.table("myTable").delete().where("id", 10).execute()
# delete without where is not possible on this way, it wil throws an error
connection.table("myTable").delete().execute()
# if you really want to delete all data in a table use this way
# the true is important, otherwise it will also throw an error
connection.table("myTable").delete().im_sure_im_not_use_conditions().execute()
# but you can still get the sql this way
connection.table("myTable").delete().get_sql()