EctoTablestore.Repo.delete
You're seeing just the callback
delete
, go back to EctoTablestore.Repo module for more information.
Specs
delete(schema_or_changeset(), options()) :: {:ok, schema()} | {:error, term()}
Delete a struct using its primary key.
Options
:condition
, this option is required, whether to add conditional judgment before data delete.- As
condition(:expect_exist)
means the primary key(s) can match a row to delete, if the row is existed, the delete result will be success, if the row is not existed, the delete result will be fail. We also can add some compare expressions for the attribute columns, e.g:condition(:expect_exist, "attr1" == value1 and "attr2" > 1) condition(:expect_exist, "attr1" != value1) condition(:expect_exist, "attr1" > 100 or "attr2" < 1000)
- As
condition(:ignore)
means DO NOT do any condition validation before delete, whether the row exists or not, both of the delete results will be success. - As
condition(:expect_not_exist)
means expect the primary key(s) are NOT existed before delete, if the row is existed, the delete result will be fail, if the row is not existed, the delete result will be success.
- As
:transaction_id
, delete under local transaction in a partition key.:stale_error_field
- The field where stale errors will be added in the returning changeset. This option can be used to avoid raisingEcto.StaleEntryError
.:stale_error_message
- The message to add to the configured:stale_error_field
when stale errors happen, defaults to "is stale".