Skip to content

v0.8.0

Choose a tag to compare

@benvinegar benvinegar released this 30 Jun 21:32
· 45 commits to main since this release
5908a8f

What's new

  • Forwards dialect-native terminal methods through scoped mutation results when supported by the underlying builder:
    • .returning(...) on scoped insert/update/delete for Postgres and SQLite.
    • .$returningId() on scoped inserts for MySQL.
  • Adds .$unsafeUnscoped() on scoped insert results as a loud, local escape for explicitly audited conflict/upsert chains.
  • Exposes .groupBy(...) and .having(...) on scoped select query builders.

Changed

  • createScopedDb now returns an explicit scoped wrapper type instead of the raw database type.
  • Scoped .returning(...) now infers row types from the target table and projection columns.
  • InferSelection preserves sql<T> fragments, aliased SQL fragments, and nested selection objects, and falls back to unknown for unrecognized leaves.
  • Scoped .leftJoin(...) and .innerJoin(...) now accept SQL | undefined for the join condition.

Fixed

  • Scoped .values(...) and .set(...) payloads now accept Drizzle sql template expressions for individual column values.
  • .$unsafeUnscoped() conflict/upsert chains now preserve table-precise .returning(...) row types.