public function delete($query, array $options = []) {
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$query = $params['query'];
			$isObject = is_object($query);

			if ($isObject) {
				$sql = $this->renderCommand('delete', $query->export($this), $query);
			} else {
				$sql = Text::insert($query, $this->value($params['options']));
			}
			$result = (boolean) $this->_execute($sql);

			if ($result && $isObject && $query->entity()) {
				$query->entity()->sync(null, [], ['dematerialize' => true]);
			}
			return $result;
		});
	}