supalite 0.5.0 → 0.5.1
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
CHANGED
|
@@ -285,6 +285,7 @@ const { data, error } = await client
|
|
|
285
285
|
- `ilike(column, pattern)`: 대소문자 구분 없는 LIKE
|
|
286
286
|
- `in(column, values)`: IN 연산자
|
|
287
287
|
- `is(column, value)`: IS 연산자
|
|
288
|
+
- `not(column, operator, value)`: Negates an operator (e.g., `not('column', 'is', null)`).
|
|
288
289
|
- `contains(column, value)`: 배열/JSON 포함 여부
|
|
289
290
|
- `or(conditions)`: OR 조건 (예: 'status.eq.active,role.eq.admin')
|
|
290
291
|
|
package/dist/query-builder.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare class QueryBuilder<T extends DatabaseSchema, S extends SchemaName
|
|
|
38
38
|
eq(column: string, value: any): this;
|
|
39
39
|
neq(column: string, value: any): this;
|
|
40
40
|
is(column: string, value: any): this;
|
|
41
|
+
not(column: string, operator: string, value: any): this;
|
|
41
42
|
contains(column: string, value: any): this;
|
|
42
43
|
in(column: string, values: any[]): this;
|
|
43
44
|
gte(column: string, value: any): this;
|
package/dist/query-builder.js
CHANGED
|
@@ -97,6 +97,16 @@ class QueryBuilder {
|
|
|
97
97
|
}
|
|
98
98
|
return this;
|
|
99
99
|
}
|
|
100
|
+
not(column, operator, value) {
|
|
101
|
+
if (operator === 'is' && value === null) {
|
|
102
|
+
this.whereConditions.push(`"${column}" IS NOT NULL`);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// 추후 다른 not 연산자들을 위해 남겨둠
|
|
106
|
+
throw new Error(`Operator "${operator}" is not supported for "not" operation.`);
|
|
107
|
+
}
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
100
110
|
contains(column, value) {
|
|
101
111
|
this.whereConditions.push(`"${column}" @> $${this.whereValues.length + 1}`);
|
|
102
112
|
this.whereValues.push(value);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 변경 보고서: `not` 메소드 추가
|
|
2
|
+
|
|
3
|
+
**날짜:** 2025년 8월 28일
|
|
4
|
+
|
|
5
|
+
## 변경 유형
|
|
6
|
+
|
|
7
|
+
- [x] 기능 추가
|
|
8
|
+
- [ ] 버그 수정
|
|
9
|
+
- [ ] 성능 개선
|
|
10
|
+
- [ ] 문서 업데이트
|
|
11
|
+
- [ ] 기타
|
|
12
|
+
|
|
13
|
+
## 변경 내용
|
|
14
|
+
|
|
15
|
+
### `QueryBuilder`
|
|
16
|
+
|
|
17
|
+
- **`not` 메소드 추가**: `is` 연산자와 함께 사용하여 `IS NOT NULL` 조건을 생성할 수 있는 `not` 메소드를 추가했습니다.
|
|
18
|
+
|
|
19
|
+
**사용 예시:**
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
const { data } = await client
|
|
23
|
+
.from('users')
|
|
24
|
+
.select('id, name')
|
|
25
|
+
.not('email', 'is', null);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
위 코드는 `SELECT "id", "name" FROM "public"."users" WHERE "email" IS NOT NULL` SQL 쿼리를 생성합니다.
|
|
29
|
+
|
|
30
|
+
## 관련 파일
|
|
31
|
+
|
|
32
|
+
- `src/query-builder.ts`
|
|
33
|
+
- `README.md`
|