agiletiger / agiletiger/ojotas

feature: optional filters

Đang mở
#4 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
9
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

One cool thing about current ORMs out there is the ability to have optional filters

in sequelize something like:
```js
model.find({where: {
...(someContidion && {someField: someValue})
});
```

in ojotas we could so something similar when writing sql

```sql
select * from user where name = :name and status = :status?
```

that should generate a type that has name as required and status as optional. if status is not provided, the AND statament should be transformed to remove that condition.

one could say that instead of removing the status condition it could be transformed to status = status. but that would only work for ANDs and not ORs so it is safer to always remove it if nor provided

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.