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

Add support for using diesel async for migrations to avoid pq-sys dep #325

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

banool
Copy link
Collaborator

@banool banool commented Mar 18, 2024

Summary

The CLI uses the processor lib for the local testnet. This means, so long as we want the local testnet to support this feature, we cannot depend on pq-sys, since that would require that all CLI users have postgres dynamic libraries on their system, which we cannot assume (nor enforce, since we don't use package managers in all cases).

To address this, we add a new feature called libpq in which we enable the postgres feature of the diesel crate. Since the CLI is an edge case, we enable this feature by default. In the code we then have two implementations of run_migrations based on whether the feature is enabled or not.

Here is the relevant change on the CLI side: aptos-labs/aptos-core#12568.

Test Plan

CI for now, including the new check against banned deps.

I tested that this works from the local testnet and it does!

@banool banool force-pushed the banool/diesel-async-migrations branch 5 times, most recently from 9643fb7 to 8f42069 Compare March 18, 2024 15:55
@banool banool force-pushed the banool/diesel-async-migrations branch 4 times, most recently from b0ec22e to 559adf0 Compare March 21, 2024 08:31
@banool banool requested a review from CapCap March 21, 2024 08:31
@banool banool changed the title Return to using diesel async for migrations to avoid pq-sys dep Add support for using diesel async for migrations to avoid pq-sys dep Mar 21, 2024
@banool banool force-pushed the banool/diesel-async-migrations branch from 559adf0 to 3fe9b37 Compare March 21, 2024 08:42
@banool banool merged commit a11f0b6 into main Mar 21, 2024
7 checks passed
@banool banool deleted the banool/diesel-async-migrations branch March 21, 2024 18:05
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.

2 participants