drizzle-team / drizzle-team/drizzle-orm

Add user input escaping function to `like/ilike/notLike/notIlike`

Open
#444 4 comments 7 reactions 0 assignees View on GitHub
db/mysql db/postgres db/sqlite enhancement qb/crud
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

>If the user searches for 100%, the % will be treated as a wildcard character rather than a character to be searched for

```ts
like(post.body, '%' + like.escape(userInput) + '%')
```

Based on Discord convo: https://discord.com/channels/1043890932593987624/1095907575033253971

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.