Commit graph

31 commits

Author SHA1 Message Date
Yiming Cao
026450bfe7
fix(orm): make orderBy nulls optional (#2670)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:13:11 -07:00
Yiming Cao
8ddbfdebdc
feat(orm): add field-level @fuzzy attribute to gate fuzzy search (#2642)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 12:41:09 -07:00
docloulou
679f91fc26
feat(orm): add fuzzy search and relevance ordering (PostgreSQL) (#2573)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-05-03 20:11:03 -07:00
Lukas Kahwe Smith
bfdfce13c0
fix(orm): accept plain date strings in DateTime @db.Date field filters (#2572)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-21 16:46:30 -07:00
ymc9
e784b672c9 chore(server): regenerate rpc OpenAPI baseline
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 12:19:36 -07:00
ymc9
064ce4a3ee fix(orm,server): fix procedure slicing in toJSONSchema and RPC OpenAPI spec
- ZodSchemaFactory.toJSONSchema() now skips makeProcedureArgsSchema for
  procedures excluded by slicing (includedProcedures / excludedProcedures),
  preventing dangling component registrations for hidden procedures
- RPCApiSpecGenerator.generateSharedSchemas() now emits enum schemas so
  $ref pointers from model entity schemas and typedef schemas resolve correctly
- RPCApiSpecGenerator requestBody.required is now only set when at least one
  procedure param is non-optional, matching the existing GET q-param behavior
- Add tests covering all three fixes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 11:39:22 -07:00
Yiming Cao
dc26257553
feat(server): add OpenAPI spec generation for RPC API (#2574)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 21:35:24 -07:00
Lukas Kahwe Smith
06f6e08b33
feat(openapi): add nestedRoutes support for openapi spec generation (#2521) 2026-03-27 09:00:53 -07:00
Lukas Kahwe Smith
169560af77
Add nested routes support in the RestApiHandler (#2454) 2026-03-23 18:25:36 -07:00
Yiming Cao
cbebe0c062
feat(server): add specific 4xx error responses to REST OpenAPI spec (#2504)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 00:05:58 -07:00
Yiming Cao
f361d32cbf
feat(server): add OpenAPI spec generation for RESTful API (#2498)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 10:07:44 -07:00
Jiasheng
17922f03e7
feat(transaction): implement transaction handling with sequential operations and validation (#2399)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-02-25 20:49:43 +08:00
Lukas Kahwe Smith
14a0a035b9
fix handling of a single column unique index with externalIdMapping (#612) 2026-01-30 21:07:44 +08:00
Yiming Cao
99f68e2f7b
feat(orm): mysql support (#616)
* WIP(orm): mysql support

* WIP: more progress with fixing tests

* WIP: get all client api tests pass

* WIP: get all tests pass

* fix executor

* add MySQL to CI matrix

* fix sqlite test runs

* fix test

* fix delete readback check

* set mysql container max connections

* fix tests

* fix test

* refactor: extract duplicated mysql/pg code into base class

* address PR comments

* refactor: remove order by duplicated code

* refactor: optimize stripTableReference

* addressing PR comments

* fix tests
2026-01-24 23:21:36 +08:00
sanny-io
27e8910830
feat: between operator (#569)
* feat: `between` operator

* chore: add tests

* Document inclusivity.

* Add reversed order test.

* chore: add REST server test

* Fix test typo.

* Verify correct object returned.

* Additional test cases.

* Make AI suggested changes.

* Remove filter.

* Fix styling.

* Add more REST tests.

* Add more int tests for REST.
2026-01-16 21:30:31 +08:00
Yiming Cao
9033211ae6
fix(server): allow Infinity as pageSize option for REST api (#581)
* fix(server): allow Infinity as pageSize option for REST api

* fix schema
2026-01-09 16:17:25 +08:00
Yiming Cao
6ac5af5ab1
fix(qaas): add options validation (#574)
* feat(cli): implement watch mode for generate

* chore(root): update pnpm-lock.yaml

* chore(cli): track all model declaration and removed paths, logs in past tense

* fix(cli): typo, unused double array from

* fix(orm): preserve zod validation errors when validating custom json types

* update

* chore(cli): move import, fix parallel generation on watch

* feat(common-helpers): implement single-debounce

* chore(cli): use single-debounce for debouncing

* feat(common-helpers): implement single-debounce

* fix(common-helpers): re run single-debounce

* fix(qaas): add options validation

* fix pr comments

---------

Co-authored-by: FTB_lag <tabolskyy.git@gmail.com>
2026-01-08 16:58:45 +08:00
Mike Willbanks
2172614e0e
custom procedures (#551)
* feat: custom procs

* chore: cleanup

* fix: remove $procedures from client

* fix: failing test due to previous alias

* feat(custom-procs)!: make procedures envelope-only via $procs

- Switch procedure calls to `db.$procs.name({ args: {...} })` (no positional args)
- Remove legacy `$procedures` alias entirely (client API + server routing/logging)
- Validate procedure envelope input (`args` object, required/unknown keys)
- Keep TanStack Query procedure hooks as `(args, options)` (with conditional args optionality)
- Update server/ORM/client tests for the envelope API

* fix: code review feedback

* fix: code review comments

* fix: coderabbit review comments

* fix: remove useless proxy method

* test: add a couple of e2e tests that verify both typing and runtime

* test: improve e2e tests

* test: add missing mutation flag

* regenerate test schema

* refactor: procedure params generation fix and type refactors

- Simplified procedure's params definition from a tuple an object, since procs are now called with an envelop now

- Refactored procedure related typing to make them more consistent with other CURD types (that usually takes the schema as the first type parameter, and a name as the second)

- Moved detailed procedure's types to "crud-types" where other ORM client detailed types are defined

- Removed some type duplication from hooks side

- Updated the "orm" sample to demonstrate procedures

* fix: disable infinite custom proc queries for now

---------

Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-01-08 11:21:51 +08:00
sanny-io
446a48335f
feat: exists operation (#550)
* feat: exists operation

* Add RPC handling.

* Add frontend handling.

* Add tests.

* Fix postgres error.

* Add JSDoc.

* Remove `@ts-expect-error`

* Disable post-processing.

* Put semicolon back.
2026-01-07 18:05:49 +08:00
Mike Willbanks
65388a5ac5
issue: rpc on update, 422 filtering error (#546)
* issue: rpc on update, 422 filtering error

the error appears to be caused by the json filtering logic, it is attempting
to utilize the filtering logic when there is an update on a list or json
field even if there are no such values to be filtered during an update
when attempting to set a new value

* fix: rpc update handling

* fix: undo the ORM side change since it's unrelated to the original issue

* fix: get back the `args ?? {}` safety guard

---------

Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2025-12-30 12:02:55 +08:00
Yiming Cao
ff0808d359
refactor: revised error system (#377)
* refactor: revised error system

* addressing PR comments
2025-11-06 21:59:27 -08:00
Yiming Cao
4e8a1f1ced
chore: several server adapter improvements (#349)
* chore: several server adapter improvements

* update
2025-10-31 15:44:39 -07:00
Yiming Cao
f9cbedc255
feat(server): migrate tanstack-start adapter (#344)
* feat(server): migrate tanstack-start adapter

* prettier format
2025-10-29 19:26:12 -07:00
Yiming Cao
fe5f61dcb6
feat(server): migrate sveltekit adapter (#343) 2025-10-29 18:41:23 -07:00
Yiming Cao
8119298f11
feat(server): migrate hono adapter (#341)
* feat(server): migrate hono adapter

* fix test
2025-10-29 17:12:50 -07:00
Yiming Cao
2525ef3fca
feat(server): migrate elysia adapter (#340)
* feat(server): migrate elysia adapter

* addressing pr comments
2025-10-29 14:45:25 -07:00
Yiming Cao
5699e5b350
feat(server): migrate fastify adapter (#339)
* feat(server): migrate fastify adapter

* addressing pr comments
2025-10-29 14:22:49 -07:00
Yiming Cao
95da8d2dc5
feat(server): migrate rest api handler (#337)
* feat(server): migrate rest api handler

* addressing PR comments

* update lock file

* fix pg string json handling

* update
2025-10-26 22:27:09 -07:00
Yiming Cao
62d731d436
feat(server): migrate next.js server adapter (#335)
* feat(server): migrate next.js server adapter

* address PR comments
2025-10-24 16:59:05 -07:00
Yiming Cao
cccd34491d
refactor: rename runtime package to orm (#332) 2025-10-23 22:07:55 -07:00
Yiming Cao
56b68ab9cc
feat(server): migrate rpc api handler and express adapter (#328)
* feat(server): migrate rpc api handler and express adapter

* fix package.json

* misc fixes

* update

* update ot express5 only

* update

* update

* fix test
2025-10-23 19:05:05 -07:00