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/drizzle-insert-defaults.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/drizzle-paging-typing.md

This file was deleted.

8 changes: 8 additions & 0 deletions packages/drizzle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @softzweig/spindle-drizzle

## 0.2.0

### Minor Changes

- [`0b1883f`](https://github.com/softzweig/spindle/commit/0b1883f2b83ee6b10a7921443abb827f4521091c) Thanks [@vinznt](https://github.com/vinznt)! - Let `insert` accept the values a table can fill itself. `AbstractDrizzleRepository` gains a `TInsert` generic that defaults to `EntityInsert<TEntity>`, and the PostgreSQL and SQLite identity bindings set it to the table's `InferInsertModel`. A column the database generates, a serial id or a `defaultNow()` timestamp for instance, can now be left out of `insert` and comes back filled on the returned entity. Repositories that map rows to their own entities keep the entity's insert shape, because column values would bypass that mapping.

- [`0b1883f`](https://github.com/softzweig/spindle/commit/0b1883f2b83ee6b10a7921443abb827f4521091c) Thanks [@vinznt](https://github.com/vinznt)! - Keep the row's own type in the identity bindings. `PostgresRepository` and `SqliteRepository` now default their entity to the new `RowEntity<TTable>` instead of `Entity & InferSelectModel<TTable>`, so filters and inserts no longer accept properties the table does not have, and a row that already carries an id stays exactly the selected type. Their `of` factory also takes the paging spec, whose entity and cursor flow into the repository, so `PostgresRepository.of(db, table, pagingByCreatedAt<Asset>)` pages newest first without widening the entity to `Entity`.

## 0.1.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/drizzle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@softzweig/spindle-drizzle",
"version": "0.1.3",
"version": "0.2.0",
"description": "Drizzle ORM repository bindings for Spindle.",
"license": "MIT",
"repository": {
Expand Down
Loading