Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/mysql-write-limit.md

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @maple-dev/effect-orm

## 1.2.0

### Minor Changes

- f8fd28d: MySQL and MariaDB `ORDER BY` and `LIMIT` on a single-table UPDATE or DELETE: `deleteFrom(table).where(...).orderBy(["id", "asc"]).limit(20000)` writes `DELETE FROM t WHERE ... ORDER BY ... LIMIT 20000`, and `update(table)` takes the same two clauses, for chunked deletes that keep each transaction small (loop until `Db.runWrite` reports fewer `affectedRows` than the limit). `orderBy` takes `[column, direction]` tuples of the table's columns or a callback of `[expression, direction]` pairs; `limit(n)` writes `n` as a literal, as a query's limit, and a negative or fractional literal is a type error, such a value at run time an `InvalidArguments` failure. Both add the new `WriteLimitClause` to the write's params, so compiling it for Postgres, SQLite, D1 or ClickHouse is a type error, and the compile refuses it as a `QueryBuilderDefect`; beside `update(...).from(...)`, a multi-table write MySQL refuses them on, they are a defect too. Tenant scope is unchanged: the WHERE decides it, and a subquery in the ORDER BY counts as a read. New: `Dialect.clauses.writeOrderLimit`, and the `WriteLimitClause` and `WriteOrderBySpec` types.

## 1.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maple-dev/effect-orm",
"version": "1.1.0",
"version": "1.2.0",
"description": "Type-safe ClickHouse, Postgres, SQLite and MySQL queries, result decoding, and reproducible benchmarks for Effect and TypeScript",
"keywords": [
"clickhouse",
Expand Down