Skip to content

perf(drizzle): single-roundtrip db updates for simple collections #13186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 23, 2025
9 changes: 8 additions & 1 deletion packages/drizzle/src/find/buildFindManyArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const buildFindManyArgs = ({
select,
tableName,
versions,
}: BuildFindQueryArgs): Record<string, unknown> => {
}: BuildFindQueryArgs): Result => {
const result: Result = {
extras: {},
with: {},
Expand Down Expand Up @@ -134,5 +134,12 @@ export const buildFindManyArgs = ({
result.with._locales = _locales
}

// Delete properties that are empty
for (const key of Object.keys(result)) {
if (!Object.keys(result[key]).length) {
delete result[key]
}
}

return result
}
Loading
Loading