Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Add abstraction for SQL databases #26

Merged
merged 3 commits into from
Aug 3, 2021
Merged

Add abstraction for SQL databases #26

merged 3 commits into from
Aug 3, 2021

Conversation

AnnikaCodes
Copy link
Contributor

@AnnikaCodes AnnikaCodes commented Apr 22, 2021

This will let us run unit tests with an in-memory database (and generally be less dependent on a particular database or database library).

Prerequisite to #27.

@HoeenCoder HoeenCoder self-requested a review April 22, 2021 18:36
@AnnikaCodes
Copy link
Contributor Author

@HoeenCoder bump?

Copy link
Member

@HoeenCoder HoeenCoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really well done, thank you so much Annika!

await database.withinTransaction([
{statement: 'UPDATE servers SET sticky = $1 WHERE serverid = $2', args: [stickyRoles, this.guild.id]},
]);
await this.massStickyUpdate(role); // I hope this works...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be best to change massStickyUpdate to return a Query instead so we can include it in the above transaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, sure

@HoeenCoder HoeenCoder merged commit 529df9c into smogon:master Aug 3, 2021
@HoeenCoder
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants