-
Notifications
You must be signed in to change notification settings - Fork 0
delete
jeaye edited this page Jun 5, 2018
·
3 revisions
NOTE: Each of these queries presented here may be incomplete and may be lacking the final rendering call: to_string.
The casst delete API begins with only one entrypoint.
casst::delete_ // DELETEThe variadic entrypoint function expects a list of lvalue column names. From there, whe need to say whence we're deleting.
This expects a single table name.
casst::delete_("col1", "col2", "col3").
from("turb")
// DELETE col1, col2, col3 FROM turbAfter this, you have several choices.
casst::delete_("col1", "col2", "col3").from("turb").
where(casst::equal("name", "meow"))
// DELETE col1, col2, col3 FROM turb WHERE name = 'meow'casst::delete_().from("people").
where(casst::row("meow").in("kitty", "cat")).
if_
(
casst::equal("name", "meow"),
casst::and_(),
casst::equal("alive", false)
)
// DELETE FROM people WHERE meow IN ( 'kitty', 'cat' )
// IF name = 'meow' AND alive = falsecasst::delete_().from("turb").if_exists()
// DELETE FROM turb IF EXISTSVery similar to update's using, except this doesn't allow for TTL, so timestamp become part of the function name.
casst::delete_().from("people").using_timestamp(476500).
where(casst::equal("alive", false))
// DELETE FROM people USING TIMESTAMP 476500 WHERE alive = false