agiletiger / agiletiger/ojotas

feature: optional filters

Ouverte
#4 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
9
Forks
4
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.