Skip to content

Releases

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 19:20
b7d7f12
  • Added. InMemorySpecification::satisfies(Specification $specification, array $row): bool — an in-memory interpreter for a specification (#40): a
    rule written once as a specification holds both in a query (the existing
    QueryApplier) and on a single row the read model already holds.
    Comparisons (=, !=, <>, <, <=, >, >=, in, not in,
    between, not between, is / is not null) and AND, OR, NOT are
    supported; ordering, LIMIT and OFFSET are ignored (they do not filter).
    Verdicts are the SQL the package actually builds, guarded by a property
    test against real SQLite: type coercion as SQL compares ('1' against 1
    agrees), a NULL row value is UNKNOWN and NOT of it stays unknown
    (three-valued logic), a NULL entry in an in/not in list is yiisoft/db's
    IS NULL / IS NOT NULL rendering, an empty in is 0=1 and an empty
    not in adds no condition. The like family, date values, raw SQL and raw
    OR conditions are refused with a LogicException naming what — as is a
    non-numeric string against a number, where SQL engines disagree on the
    coercion.

v1.3.3

Choose a tag to compare

@github-actions github-actions released this 13 Sep 17:40
68491f2

Fixed

  • Reject unknown operators in direct OrConditionSpecification conditions
    instead of allowing SQL syntax to be injected through the operator position.
  • SpecificationBuilder::orWhere() now keeps ORDER BY, LIMIT and OFFSET
    outside OR branches, and nested orWhere() / notWhere() callbacks retain
    the builder returned by the callback.
  • BETWEEN values must be zero-based lists with exactly two elements, so
    malformed associative arrays fail during specification construction.
  • DateTimeInterface values are passed through yiisoft/db's timezone-aware
    DateTimeValue with six-digit fractional precision.
  • Update the test adapter dependency to rasuvaeff/property-testing-testo
    ^0.10.
  • Direct NOT specifications now preserve nested ORDER BY, LIMIT and
    OFFSET modifiers, matching the existing OR behavior.
  • Canonical three-element LIKE conditions in OrConditionSpecification now
    reject non-string patterns instead of passing malformed input to the query
    builder.
  • Track build/.gitkeep so coverage and other build outputs have a directory
    in fresh checkouts.
  • Document the public OrderBySpecification and LimitSpecification classes.

v1.3.1

Choose a tag to compare

@github-actions github-actions released this 13 Sep 15:49
df90375

Fixed

  • An OR condition written as ['is', value] / ['is not', value] (or handed
    to OrConditionSpecification as ['is', column, value]) was passed to
    yiisoft/db verbatim and rendered col IS 'value' — a syntax error on MySQL
    and PostgreSQL that SQLite alone accepts. The OR path now maps is / is not
    to = / != exactly as visitComparison() does: a null operand still
    renders IS NULL / IS NOT NULL, any other operand a plain equality (#34).

v1.3.0

Choose a tag to compare

@github-actions github-actions released this 13 Sep 14:11
d55fe77

Fixed

  • Renaming a colliding raw placeholder also rewrote every sibling it was a
    prefix of: :sort → :sort_0 turned :sort_max into :sort_0_max, which
    nothing bound, and the query failed with column index out of range. The
    rename now replaces whole :name tokens only, in one pass (#30).
  • Two RawSpecifications reusing one placeholder name under a single
    CompositeSpecification overwrote each other's value, so a AND b selected
    a different row set than b AND a. visitRaw() now routes its params
    through the same remap as NOT/OR: the second leaf binds :name_0. As a
    consequence getParams() keys of raw leaves are always colon-prefixed
    (['age' => 18] is bound as ':age'); positional ? params keep their
    integer keys instead of being turned into a :0 name (#31).

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 12 Sep 17:20
a1d89b1

Fixed

  • startsWith(), endsWith() and contains() searched for a literal %:
    yiisoft/db ≥ 2.0 escapes the LIKE value and wraps it in %…% unless told
    otherwise, so the wildcard the factory added was escaped. The three helpers
    now hand a clean string to the builder with mode: LikeMode::StartsWith
    / EndsWith / Contains, and like() / notLike() send the pattern
    verbatim (mode: Custom, escape: false) — also for a ['like', col, pattern] entry of withOrCondition(). ilike / not ilike no longer
    render a verbatim ILIKE (a syntax error outside PostgreSQL): they are
    LIKE with caseSensitive: false. New LikeMatch enum,
    ComparisonSpecification::getLikeMatch() and an optional $likeMatch
    argument on the constructor, CompositeSpecification::withComparison()
    and SpecificationBuilder::where(). A custom visitor that reads
    getValue() of a startsWith() / endsWith() / contains() specification
    now gets the bare string and must honour getLikeMatch() (#27).

Changed

  • Add a zizmor GitHub Actions security audit workflow and skip heavy CI jobs on irrelevant changes via a path-aware gate.

v1.1.0

Choose a tag to compare

@rasuvaeff rasuvaeff released this 01 Aug 22:45
395ea0f
  • Ship an AI agent skill (resources/skills/rasuvaeff-specification/SKILL.md
    • extra.skills in composer.json): projects using the llm/skills Composer
      plugin get the skill synced into .agents/skills/ automatically on install.
  • Bump dev dependency rasuvaeff/property-testing to ^2.6.

v1.0.2

Choose a tag to compare

@rasuvaeff rasuvaeff released this 01 Aug 22:45
02385b1
  • Add /benchmarks and /Makefile to .gitattributes export-ignore.

v1.0.1

Choose a tag to compare

@rasuvaeff rasuvaeff released this 01 Aug 22:45
f238bd9
  • Migrate tests from PHPUnit to Testo (testo/testo + testo/bridge-infection + testo/bench).

v1.0.0

Choose a tag to compare

@rasuvaeff rasuvaeff released this 31 May 10:57

Initial release.