Add support for using diesel async for migrations to avoid pq-sys dep #325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thepostgres
feature of thediesel
crate. Since the CLI is an edge case, we enable this feature by default. In the code we then have two implementations ofrun_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!