Skip to content

Builder Delete

Miku edited this page Mar 17, 2023 · 3 revisions

Delete data from the database

First

Example

conn.table("myTable").delete()

Repeatable

Endpoints

  • execute()
  • get_sql()

Example Code

# 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()