Skip to content

Yield SQLUpdates more efficiently #595

@Lambdanaut

Description

@Lambdanaut

In the new templates, we have a lot of functions that return SQLUpdate
however, one of the main benefits to moving to the coroutine model was to avoid ever having to return SQLUpdate anywhere (it's an anti-pattern!).

We should instead just yield whenever necessary to get the DB query executed right away (which we couldn't do in Paima v1)

For functions that only execute a single query, this will be simple, however for functions that execute multiple queries, we'll need to break it apart to yield the SQLUpdates at the appropriate times.

Example of function that returns SQLUpdate at the end:

Image

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions