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

Refactor the code to make it easier to support multiple db backends in the future. #350

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

grao1991
Copy link
Contributor

@grao1991 grao1991 commented Apr 17, 2024

Restructure the directories.
Rename several variables to remove "Pg".
Remove some unused methods.

Tested on the local machine, verified both manually running migration and running migration through rust code can work.

Instructions

  • cd into the database folder you use under src/db/ (e.g. src/db/postgres), then run it.

@grao1991 grao1991 force-pushed the grao_features branch 11 times, most recently from ca5227e to 5b26a4f Compare April 17, 2024 23:38
@grao1991 grao1991 marked this pull request as ready for review April 17, 2024 23:40
@grao1991 grao1991 force-pushed the grao_features branch 2 times, most recently from 1c28d39 to 1212282 Compare April 18, 2024 22:51
@larry-aptos larry-aptos requested a review from yuunlimm April 18, 2024 23:06
Copy link
Collaborator

@bowenyang007 bowenyang007 left a comment

Choose a reason for hiding this comment

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

There's a problem. Running migrations manually the old way anymore. We have to cd into the new folder to run migrations. It also generates schema in a different location. Can you actually try it and update the readme? Also please add test plan.

@grao1991 grao1991 force-pushed the grao_features branch 2 times, most recently from a286c76 to 2c60fe2 Compare April 24, 2024 23:39
@grao1991 grao1991 requested a review from bowenyang007 April 25, 2024 00:46
@grao1991
Copy link
Contributor Author

There's a problem. Running migrations manually the old way anymore. We have to cd into the new folder to run migrations. It also generates schema in a different location. Can you actually try it and update the readme? Also please add test plan.

Tested and added one line in README.

@grao1991 grao1991 force-pushed the grao_features branch 2 times, most recently from 80df6f9 to b4b3b92 Compare June 11, 2024 04:42
Copy link
Contributor

Choose a reason for hiding this comment

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

please make this pub

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

The command should be run inside src/db/postgres/

@@ -0,0 +1 @@
pub(crate) mod common;
Copy link
Contributor

Choose a reason for hiding this comment

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

pub again, no? otherwise how will SDK use any of this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@grao1991 grao1991 merged commit 98386c6 into main Jun 11, 2024
7 checks passed
@grao1991 grao1991 deleted the grao_features branch June 11, 2024 21:46
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.

4 participants