You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incus uses a built-in code generator for most of its database interactions.
Unfortunately not all entities have yet been moved over to that mechanism, causing us to have far more SQL code in our code tree than we'd really like.
The goal here is to define new code generated functions in internal/server/db/cluster/ and then remove the old implementation from internal/server/db/ transitioning everything over to the new generated functions.
A recent example of the database generator being used can be found here: #655
Note that some of the syntax has since evolved, so you may want to look at the current version of networks_integrations.go to see how to invoke the generator.
The text was updated successfully, but these errors were encountered:
Hi, I was wondering do you know where I can find good documentation on go generate?
It seems network zone have many function to migrate and I cannot find good examples in the actual codebase to inspire from, so I would like to understand better.
Notably I haven't seen a DeleteOne-by-ID, or examples for functions such as GetNetworkZoneKeys, also we have some functions that takes tx *sql.Tx as the first parameter which is unusual compared to the usual ctx context.Context.
Therefore I'm wondering on the way of handling those cases that's why I'm asking if you have some documentation to learn from somewhere?
Incus uses a built-in code generator for most of its database interactions.
Unfortunately not all entities have yet been moved over to that mechanism, causing us to have far more SQL code in our code tree than we'd really like.
The goal here is to define new code generated functions in
internal/server/db/cluster/
and then remove the old implementation frominternal/server/db/
transitioning everything over to the new generated functions.A recent example of the database generator being used can be found here:
#655
Note that some of the syntax has since evolved, so you may want to look at the current version of
networks_integrations.go
to see how to invoke the generator.The text was updated successfully, but these errors were encountered: