1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# samkhya-postgres — PostgreSQL extension adapter for samkhya.
#
# Design choice (v1.0): pgrx is opt-in behind both
# (1) the `pg_extension` Cargo feature, AND
# (2) the `samkhya_pgrx_enabled` rustc cfg flag (typically set via
# `RUSTFLAGS="--cfg=samkhya_pgrx_enabled"` or `.cargo/config.toml`).
# The Postgres major version is **pinned to pg17** in v1.0.
#
# # Why double-gating (feature + cfg)?
#
# pgrx 0.12.9's `pgrx-pg-sys` build script:
# - panics at bindgen-time when more than one `pg$VERSION` feature
# is simultaneously active, and
# - requires PostgreSQL development headers
# (`postgresql-server-dev-*`) plus a `~/.pgrx/config.toml`
# populated by `cargo pgrx init`.
#
# Cargo's `--all-features` (used by workspace-wide gates like
# `cargo check --workspace --all-features`) activates every feature
# declared in `[features]`. If `pg_extension` lived in `[features]`
# alone and pulled pgrx in via a normal `[dependencies]` entry, those
# gates would always trigger the pgrx-pg-sys build script and panic
# on hosts without PG dev headers (i.e., every CI runner and most
# downstream consumers).
#
# By moving the pgrx dependency to
# `[target.'cfg(samkhya_pgrx_enabled)'.dependencies]`, pgrx is
# excluded from the dep graph unless the `samkhya_pgrx_enabled` cfg
# is explicitly set by the operator at build time. The `pg_extension`
# Cargo feature remains as the visible knob in `[features]`, but
# under `--all-features` it is a no-op: the `dep:pgrx` reference is
# silently dropped because the target predicate evaluates to false.
#
# # Why pin to pg17?
#
# pgrx 0.12.9 multiplexes pg13..pg17 as parallel features that each
# forward `pgrx/pgNN` to `pgrx-pg-sys`. Even with `compile_error!`
# guarding our manifest, pgrx-pg-sys's build script panics before our
# guard ever fires under `--all-features` (build-script execution
# precedes proc-macro/source compilation). A single-version pin
# sidesteps the multiplexing entirely. v1.1 will restore pg13..pg16
# when either:
# - pgrx 0.13+ removes the feature-multiplexing constraint, or
# - the pgrx-using code is moved to a non-workspace sub-crate that
# does not participate in `--workspace --all-features` gates.
#
# See `feedback-pgrx-feature-isolation` memory for the full
# design-decision record and retire conditions.
[]
= "samkhya-postgres"
= true
= true
= true
= true
= true
= true
= true
= "PostgreSQL adapter for samkhya — portable cardinality correction hooks"
= "README.md"
= ["postgres", "cardinality", "query-optimizer"]
= ["database"]
[]
= ["cdylib", "rlib"]
[]
# Declare the kill-switch cfg flag so rustc's `unexpected_cfgs`
# (implied by `-D warnings`) does not flag uses of
# `#[cfg(samkhya_pgrx_enabled)]` in src/lib.rs.
= { = "warn", = ['cfg(samkhya_pgrx_enabled)'] }
[]
= []
# Advertises the pgrx extension capability. To actually build the
# extension, the operator must ALSO set
# `RUSTFLAGS="--cfg=samkhya_pgrx_enabled"` (or equivalent in
# `.cargo/config.toml`). Without that cfg flag this feature is a
# no-op: the pgrx dependency is excluded from the dep graph by the
# target-cfg predicate, and the extension module in src/lib.rs is
# gated on `cfg(samkhya_pgrx_enabled)` so its `use pgrx::...` lines
# never compile.
#
# The double-gating is intentional: it lets workspace gates like
# `cargo check --workspace --all-features` enable this feature
# harmlessly while preventing pgrx-pg-sys's bindgen panic on hosts
# without PG dev headers.
= ["dep:pgrx", "pgrx/pg17"]
# pgrx test harness flag — separate from `pg_extension` because
# `cargo pgrx test` toggles it independently.
= []
[]
= true
# pgrx lives under a target-cfg predicate so it is only resolved when
# the operator explicitly enables `samkhya_pgrx_enabled`. See the
# top-of-file comment for the rationale.
[]
= { = "0.12", = true }
[]
# docs.rs lacks PG headers; build without the extension feature.
= true