Skip to content

Commit

Permalink
format: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FGoessler committed Jan 7, 2025
1 parent 9c9bf6a commit d1f69e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub async fn delete_records<'conn>(
let ids = if let Some(selectors) = record_filter.selectors {
selectors
.into_iter()
.take(limit.unwrap_or(std::i64::MAX) as usize)
.take(limit.unwrap_or(i64::MAX) as usize)
.map(|p| {
(&id_field, p.values().next().unwrap())
.into_bson()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ async fn delete_many(
q: DeleteManyRecords,
traceparent: Option<TraceParent>,
) -> InterpretationResult<QueryResult> {
let res = tx.delete_records(&q.model, q.record_filter, q.limit, traceparent).await?;
let res = tx
.delete_records(&q.model, q.record_filter, q.limit, traceparent)
.await?;

Ok(QueryResult::Count(res))
}
Expand Down
4 changes: 3 additions & 1 deletion query-engine/core/src/query_graph_builder/write/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ pub fn delete_many_records(
Some(where_arg) => extract_filter(where_arg.value.try_into()?, &model)?,
None => Filter::empty(),
};
let limit = field.arguments.lookup(args::LIMIT)
let limit = field
.arguments
.lookup(args::LIMIT)
.and_then(|limit_arg| match limit_arg.value {
ParsedInputValue::Single(PrismaValue::Int(i)) => Some(i),
_ => None,
Expand Down

0 comments on commit d1f69e1

Please sign in to comment.