@vibeorm/extensions 2.0.0-alpha.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +41 -2
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -3,10 +3,10 @@
3
3
  > A type-safe TypeScript ORM for Bun and Node. Prisma-schema or TypeScript-DSL input, a canonical schema IR, a generated client that your editor never re-infers, and a dialect-aware SQL layer over PostgreSQL, PGlite, SQLite and MySQL.
4
4
 
5
5
  ```bash
6
- bun add @vibeorm/extensions@alpha
6
+ bun add @vibeorm/extensions
7
7
  ```
8
8
 
9
- > **Pre-release.** `2.0.0-alpha.x`, published under the `alpha` dist-tag. `npm i vibeorm` still resolves to the stable v1 line, which has a different API — see the migration guide below.
9
+ > **Stable.** `2.0.0`, published under the `latest` dist-tag. The v1 line stays installable as `vibeorm@1`, and is a different API — see the migration guide below.
10
10
 
11
11
  ## What it provides
12
12
 
@@ -99,6 +99,45 @@ The query is split into unicode letter/number tokens (punctuation separates and
99
99
  - `engine: "bm25"` refuses `prefix` (`VIBE_UNSUPPORTED_CAPABILITY`) — ParadeDB prefix behavior is decided by the index tokenizer, which this extension does not configure.
100
100
  - mysql InnoDB ignores tokens shorter than `innodb_ft_min_token_size` (default 3), so one- and two-letter prefixes match nothing there.
101
101
 
102
+ ### Filtering hits: `where` composes with the core filter language
103
+
104
+ `search({ where })` compiles through the same filter compiler as every core query — scalar
105
+ filters, relation filters and `dbNow()` comparisons all AND into the match. The menu
106
+ composition (type-ahead over items that are orderable *right now*):
107
+
108
+ ```prisma
109
+ model MenuItem {
110
+ id Int @id @default(autoincrement())
111
+ name String
112
+ description String
113
+ availableFrom DateTime?
114
+ availableTo DateTime?
115
+ category Category? @relation(fields: [categoryId], references: [id])
116
+ categoryId Int?
117
+
118
+ @@search([name, description], weights: [2, 1], language: "simple")
119
+ }
120
+ ```
121
+
122
+ ```ts
123
+ import { dbNow } from "@vibeorm/runtime";
124
+
125
+ const hits = await db.menuItem.search({
126
+ query: "piz", // mid-keystroke
127
+ prefix: true,
128
+ take: 8,
129
+ where: {
130
+ category: { is: { active: true } },
131
+ availableFrom: { lte: dbNow() }, // the DATABASE's clock, not the process's
132
+ availableTo: { gte: dbNow() },
133
+ },
134
+ });
135
+ ```
136
+
137
+ For typo tolerance ("piza") declare `@@trgm([name])` too and fall back to
138
+ `findMany({ where: { name: { similarTo: query } } })` when a prefix search returns nothing
139
+ (postgres/pglite only).
140
+
102
141
  ### Hydrating hits with relations
103
142
 
104
143
  `search()` returns bare rows — it has no `include`/`select` of relations. The intended pattern is the `select: "id"` projection plus a re-read through your own typed query, which carries relations, `omit`, computed fields and everything else the core API does:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeorm/extensions",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.0",
4
4
  "description": "Tier-1 VibeORM extensions — full-text search, pgvector similarity and pg_trgm fuzzy matching",
5
5
  "keywords": [
6
6
  "orm",
@@ -54,9 +54,9 @@
54
54
  "bun": ">=1.2.0"
55
55
  },
56
56
  "dependencies": {
57
- "@vibeorm/runtime": "2.0.0-alpha.7",
58
- "@vibeorm/schema": "2.0.0-alpha.5",
59
- "@vibeorm/sql": "2.0.0-alpha.5"
57
+ "@vibeorm/runtime": "2.0.0",
58
+ "@vibeorm/schema": "2.0.0",
59
+ "@vibeorm/sql": "2.0.0"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"