Skip to content

python: query an equality term #1391

Open

Description

@yujiyokoo

Created with Claude Code from the spec in #1341.

Parent

Sub-issue of #1341. Ticket 10 of 14.

What to build

Equality search over an encrypted column:

term = cipher.query("email", "a@example.com")
cur.execute("SELECT * FROM users WHERE email = %s::eql_v4.query_text_eq", (term,))

query returns a str query term. The cast domain is the marker's query_sql_domain; the = operator between the column domain and the query domain compares the eq_term of both sides and uses the eq_term index. The call makes no ZeroKMS request (the index key is in the keyset already loaded).

Codes: QUERY_UNSUPPORTED when the field's marker has no query (for example Text), QUERY_UNKNOWN_FIELD when the name is not a declared field. Value checks are the same as encrypt.

Acceptance criteria

  • The snippet finds the row inserted in ticket 8 and no others when two rows with different emails exist.
  • EXPLAIN on the query shows the eq_term index used when it exists on the column.
  • cipher.query("bio", ...) on a Text field raises QueryError with QUERY_UNSUPPORTED; an unknown name raises QUERY_UNKNOWN_FIELD.
  • The request counter does not move across 100 query calls after the client is built.
  • Wrong value type raises InvalidValueError VALUE_WRONG_TYPE.
  • The README stub gains the query snippet and the eq_term index DDL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SDKready-for-agentFully specified and ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions