Skip to content

slonik@49.10.5

Choose a tag to compare

@github-actions github-actions released this 16 Jun 15:24
· 5 commits to main since this release
a0c24f6

Patch Changes

  • 86c123c Thanks @gajus! - Fix the value-binding-only query guard for tagged queries

    A query whose entire body is a single value binding (e.g.
    pool.query(sql.unsafe\${'something'}`)) is meant to be rejected with InvalidInputError("Unexpected SQL input. Query cannot be empty. Found only value binding."). Since the migration to Slonik's internal$slonik_Nplaceholders, the guard ran against the not-yet-converted SQL and compared it to$1, while the tag actually produces $slonik_1` at that point — so the check
    never fired for real tagged queries and they were forwarded to PostgreSQL
    instead (where they fail with a less helpful syntax error).

    The placeholder conversion now happens before the validation, so the guard
    correctly detects value-only queries regardless of how they are constructed. The
    existing test only exercised a hand-built $1 token; a regression test that goes
    through the tag has been added.

  • Updated dependencies []:

    • @slonik/driver@49.10.5
    • @slonik/errors@49.10.5
    • @slonik/pg-driver@49.10.5
    • @slonik/sql-tag@49.10.5
    • @slonik/utilities@49.10.5