Skip to content
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

Use 1 statement for multiple queries #4524

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dullbananas
Copy link
Collaborator

Functions will now return a query instead of running it, so multiple queries can be combined into a single select statement that selects each query's results as arrays (see the changes in site/read.rs for an example). This will significantly reduce the amount of database connections.

Functions that need to run 2 queries (such as PostView::list) will run the first query then return the next query.

Things like CollectTuples are being worked on in a separate crate: https://codeberg.org/dullbananas/diesel-utils/src/branch/main/crates/diesel-array-agg/src/lib.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant