supabase-typed-query 0.12.0 → 1.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.
- package/README.md +39 -0
- package/dist/index.js +230 -324
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +231 -322
- package/dist/index.mjs.map +1 -1
- package/dist/src/entity/core.d.ts +5 -2
- package/dist/src/entity/core.d.ts.map +1 -1
- package/dist/src/entity/types.d.ts +12 -6
- package/dist/src/entity/types.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/query/Query.d.ts +18 -13
- package/dist/src/query/Query.d.ts.map +1 -1
- package/dist/src/query/QueryBuilder.d.ts +6 -0
- package/dist/src/query/QueryBuilder.d.ts.map +1 -1
- package/dist/src/query/index.d.ts +19 -19
- package/dist/src/query/index.d.ts.map +1 -1
- package/dist/src/query/rpc.d.ts +7 -5
- package/dist/src/query/rpc.d.ts.map +1 -1
- package/package.json +31 -33
package/README.md
CHANGED
|
@@ -128,8 +128,47 @@ const selectedPosts = await query(supabase, "posts", {
|
|
|
128
128
|
const drafts = await query(supabase, "posts", {
|
|
129
129
|
published_at: { is: null },
|
|
130
130
|
}).many()
|
|
131
|
+
|
|
132
|
+
// IS NOT NULL checks (using NOT operator)
|
|
133
|
+
const publishedPosts = await query(supabase, "posts", {
|
|
134
|
+
not: { is: { published_at: null } },
|
|
135
|
+
}).many()
|
|
136
|
+
|
|
137
|
+
// NOT IN queries
|
|
138
|
+
const activePosts = await query(supabase, "posts", {
|
|
139
|
+
not: { in: { status: ["draft", "archived"] } },
|
|
140
|
+
}).many()
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### NOT Operator
|
|
144
|
+
|
|
145
|
+
The `not` operator follows Supabase conventions for negating conditions:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// IS NOT NULL - find posts with external_id set
|
|
149
|
+
const linkedPosts = await PostEntity.getItems({
|
|
150
|
+
not: { is: { external_id: null } },
|
|
151
|
+
}).many()
|
|
152
|
+
|
|
153
|
+
// IS NOT TRUE / IS NOT FALSE
|
|
154
|
+
const nonFeatured = await PostEntity.getItems({
|
|
155
|
+
not: { is: { featured: true } },
|
|
156
|
+
}).many()
|
|
157
|
+
|
|
158
|
+
// NOT IN - exclude specific statuses
|
|
159
|
+
const visiblePosts = await PostEntity.getItems({
|
|
160
|
+
not: { in: { status: ["spam", "trash", "deleted"] } },
|
|
161
|
+
}).many()
|
|
162
|
+
|
|
163
|
+
// Combine NOT with other conditions
|
|
164
|
+
const activeLinkedPosts = await PostEntity.getItems({
|
|
165
|
+
where: { status: "published" },
|
|
166
|
+
not: { is: { external_id: null } },
|
|
167
|
+
}).many()
|
|
131
168
|
```
|
|
132
169
|
|
|
170
|
+
> **Note**: `neq: null` is deprecated. Use `not: { is: { field: null } }` instead for IS NOT NULL checks.
|
|
171
|
+
|
|
133
172
|
### Chaining OR Conditions
|
|
134
173
|
|
|
135
174
|
```typescript
|