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
There are some places where we are creating multiple SqlxDatabase instances, like here.
Desired behavior
The SqlxDatabse struct should be created once per db file/process (we currently have only one db file).
One way to achieve this would be to add a OnceLock inside the SqlxDatabase struct so that it gets initialized only once in the create function.
Another approach would be to investigate how can we refactor the creation of the database instance so it's just created once. That would mean detecting all the places where we are creating the database object multiple times and refactoring them accordingly.
The text was updated successfully, but these errors were encountered:
@u-na-gi That's awesome, this is all yours. Please let us know if you have any questions as you explore. You can also ask questions on the contributors discord https://discord.ockam.io
Current behavior
There are some places where we are creating multiple
SqlxDatabase
instances, like here.Desired behavior
The
SqlxDatabse
struct should be created once per db file/process (we currently have only one db file).One way to achieve this would be to add a
OnceLock
inside theSqlxDatabase
struct so that it gets initialized only once in thecreate
function.Another approach would be to investigate how can we refactor the creation of the database instance so it's just created once. That would mean detecting all the places where we are creating the database object multiple times and refactoring them accordingly.
The text was updated successfully, but these errors were encountered: