Skip to content

Restrict LIKE and ILIKE to supported PostgreSQL types #60

Description

@alexeichhorn

Problem

like and ilike currently use the general comparison-value bounds, so unrelated operands compile:

Metric::attempts.like(1_i32);
Event::id.ilike(uuid::Uuid::nil());

PostgreSQL rejects the generated operators at execution time.

Expected behavior

  • Restrict LIKE sources and patterns to supported text and BYTEA operands.
  • Restrict ILIKE to text operands; PostgreSQL does not provide BYTEA ILIKE.
  • Support required/nullable source and pattern combinations with the correct optional boolean output.
  • Apply the same restrictions to columns and computed expressions.
  • Add compile-fail coverage for numeric, UUID, date/time, and other unrelated types.
  • Preserve &str convenience for text patterns.

Use separate marker traits if necessary because LIKE and ILIKE do not have the same PostgreSQL operand set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions