# rsql-typeorm

> RSQL to typeorm query adapter

Latest version **1.2.11** (published 2023-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install rsql-typeorm
pnpm add rsql-typeorm
yarn add rsql-typeorm
bun add rsql-typeorm
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.11 |
| Published | 2023-11-10 |
| First published | 2022-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 19.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | João Alex |
| Maintainers | joao-ava |
| Keywords | rsql, fiql, typeorm |

## Links

- npm: https://www.npmjs.com/package/rsql-typeorm
- Repository: https://github.com/Joao-ava/rsql-typeorm
- Homepage: https://github.com/Joao-ava/rsql-typeorm#readme
- Issues: https://github.com/Joao-ava/rsql-typeorm/issues
- npm.io page: https://npm.io/package/rsql-typeorm

## Dependencies (5)

- [typeorm](https://npm.io/package/typeorm.md) ^0.3.11
- [@rsql/ast](https://npm.io/package/@rsql/ast.md) ^1.4.0
- [@rsql/parser](https://npm.io/package/@rsql/parser.md) ^1.4.0
- [@rsql/builder](https://npm.io/package/@rsql/builder.md) ^1.4.0
- [@rsql/emitter](https://npm.io/package/@rsql/emitter.md) ^1.4.0

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.2.11 (latest) — 2023-11-10
- 1.2.10 — 2023-10-02
- 1.2.9 — 2023-07-11
- 1.2.8 — 2023-07-10
- 1.2.7 — 2023-07-07
- 1.2.6 — 2023-07-05
- 1.2.5 — 2023-05-18
- 1.2.4 — 2023-05-17
- 1.1.4 — 2023-02-22
- 1.0.4 — 2022-11-04
- 1.0.3 — 2022-10-26
- 1.0.2 — 2022-10-26
- 1.0.1 — 2022-10-24

## README

# rsql-typeorm

Is a implementation RSQL adapter to typeorm.

## Operations

|Operation|Description|
|-|-|
|`==`|Equals operation|
|`>`|Greather than operation|
|`>=`|Greather than or equal operation|
|`<`|Less than operation|
|`<=`|Less than or equal operation|
|`!=`|Not equals operation|
|`=in=`|In list operation|
|`=out=`|Out list operation|
|`;`|And operation|
|`,`|Or operation|

## Examples

Get from expression [@rsql/builder](https://github.com/piotr-oles/rsql/tree/master/packages/builder):

```ts
import builder from '@rsql/builder';
import { adaptRsqlExpressionToQuery } from 'rsql-typeorm';

// equals
adaptRsqlExpressionToQuery(builder.eq(selector, value));
```

Get from string:

```ts
import { adaptRsqlStringToQuery } from 'rsql-typeorm';

// equals
adaptRsqlStringToQuery('name==John');

// greater than
adaptRsqlStringToQuery('createdAt>2022-02-02');

// in
adaptRsqlStringToQuery('name=in=(John,Doe)');

// like
adaptRsqlStringToQuery('name==*John*');

// complex query
adaptRsqlStringToQuery('title==foo*;(updated<-P1D,title==*bar)');
```

For more details about [FIQL read RFC about](https://datatracker.ietf.org/doc/html/draft-nottingham-atompub-fiql-00).

---
_Source: https://npm.io/package/rsql-typeorm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
