Skip to content

feat: add deadpool option to opt out of deadpool-postgres support - #337

Closed
ViglaOps wants to merge 1 commit into
cornucopia-rs:mainfrom
ViglaOps:deadpool-opt
Closed

ViglaOps wants to merge 1 commit into
cornucopia-rs:mainfrom
ViglaOps:deadpool-opt

Conversation

@ViglaOps

@ViglaOps ViglaOps commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

When deadpool = false (config or --deadpool CLI flag), the generated crate omits the deadpool client module, the deadpool feature, and the deadpool-postgres and postgres dependencies, leaving a plain tokio-postgres client. Defaults to true, so existing setups are unaffected.

The basic_async_wasm example now uses this, dropping its generated deadpool module.

This compliments query_typed work described by #305

How has this been tested?

I use this in production in a cloudflare workers + hyperdrive setup

The following has been done

  • PR title is prefixed with feat:, fix:, chore:, or docs:
  • The message body above clearly illustrates what problems it solves
  • If this PR has changed code within src, codegen for the repo has been run with cargo run --package test_integration -- --apply-codegen

Tests and linting

  • Formatting has been run with cargo fmt
  • Tests and lints have been run with cargo test --all and cargo clippy

When `deadpool = false` (config or `--deadpool` CLI flag), the generated
crate omits the deadpool client module, the `deadpool` feature, and the
`deadpool-postgres` and `postgres` dependencies, leaving a plain
tokio-postgres client. Defaults to true, so existing setups are
unaffected.

The basic_async_wasm example now uses this, dropping its generated
deadpool module.
@beanpuppy

Copy link
Copy Markdown
Contributor

Thanks for the PR. Just one question.

What's the use case for this that adding default-features = false doesn't solve, which is what the basic_async_wasm example already does ? I want to make sure I'm not missing something. If it's just to get rid of the unused deadpool module, I'm not sure it's worth the extra cost of a new config option and adding a whole new permutation to the codegen.

@ViglaOps

ViglaOps commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

You are not missing anything - mostly for dropping the dependency & unused module.

I buy that this isn't worth the extra config and codegen changes. Thanks for looking :)

@ViglaOps ViglaOps closed this Nov 7, 2026
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