Skip to content

Commit 703ac04

Browse files
committed
docs(sql): fix 'v' field documentation inconsistency in count_encrypted_with_active_config
**Problem:** Documentation incorrectly stated that the 'v' field stores the active configuration ID, contradicting src/encrypted/constraints.sql:56 which correctly documents that 'v' must be the literal payload version "2". **Root Cause:** The 'v' field serves a single, consistent purpose across the entire codebase: it stores the EQL payload format version (currently "2"). It does NOT store configuration IDs. **Fix:** - Removed incorrect claim that 'v' stores configuration ID - Clarified that 'v' field stores payload version "2" - Updated function description to avoid implementation details - Added note explaining the distinction **Files Changed:** - src/encryptindex/functions.sql:201-209 **Verification:** - ✅ All tests passing (59 test files) - ✅ Documentation now consistent with src/encrypted/constraints.sql:56 - ✅ No code changes - documentation-only fix **Context:** This addresses feedback about major documentation inconsistency where two different files made contradictory claims about the 'v' field's purpose. The payload version is always "2" for EQL v2, as enforced by the _encrypted_check_v validation function.
1 parent ee4e0ba commit 703ac04

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/encryptindex/functions.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ $$ LANGUAGE plpgsql;
198198
--! @brief Count rows encrypted with active configuration
199199
--! @internal
200200
--!
201-
--! Counts rows in a table where the encrypted column's version ('v' field)
202-
--! matches the active configuration ID. Used to track encryption progress.
201+
--! Counts rows in a table where the encrypted column was encrypted using
202+
--! the currently active configuration. Used to track encryption progress.
203203
--!
204204
--! @param table_name text Name of table to check
205205
--! @param column_name text Name of encrypted column to check
206-
--! @return bigint Count of rows matching active config version
206+
--! @return bigint Count of rows encrypted with active configuration
207207
--!
208-
--! @note Checks 'v' field in encrypted JSONB payload
209-
--! @note Compares to active configuration's ID
208+
--! @note The 'v' field in encrypted payloads stores the payload version ("2"), not the configuration ID
209+
--! @note Configuration tracking mechanism is implementation-specific
210210
CREATE FUNCTION eql_v2.count_encrypted_with_active_config(table_name TEXT, column_name TEXT)
211211
RETURNS BIGINT
212212
AS $$

0 commit comments

Comments
 (0)