# jooq.ts

> This project aims to provide a replacement for [jOOQ](https://www.jooq.org/) from the java world.

Latest version **0.2.4** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install jooq.ts
pnpm add jooq.ts
yarn add jooq.ts
bun add jooq.ts
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2024-04-25 |
| First published | 2021-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 221.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | emcell |

## Links

- npm: https://www.npmjs.com/package/jooq.ts
- Repository: https://github.com/emcellsoft/jooq.ts
- Issues: https://github.com/emcellsoft/jooq.ts/issues
- npm.io page: https://npm.io/package/jooq.ts

## Dependencies (3)

- [pg](https://npm.io/package/pg.md) ^8.5.1
- [pg-format](https://npm.io/package/pg-format.md) ^1.0.4
- [@types/pg-format](https://npm.io/package/@types/pg-format.md) ^1.0.2

## Recent versions

- 0.2.4 (latest) — 2024-04-25
- 0.2.3 — 2024-02-05
- 0.2.2 — 2023-12-13
- 0.2.1 — 2023-12-13
- 0.2.0 — 2022-06-09
- 0.1.40 — 2021-12-20
- 0.1.39 — 2021-11-29
- 0.1.38 — 2021-09-16
- 0.1.37 — 2021-09-16
- 0.1.36 — 2021-09-15
- 0.1.35 — 2021-09-15
- 0.1.34 — 2021-07-28
- 0.1.33 — 2021-05-26
- 0.1.32 — 2021-05-26
- 0.1.31 — 2021-05-26
- … 31 more at https://npm.io/package/jooq.ts/versions

## README

# tsooq

This project aims to provide a replacement for [jOOQ](https://www.jooq.org/) from the java world.

I've always loved to use jOOQ in my java or kotlin projects. This has always
been the missing part of the typescript eco system for me.

This library is experimental and in early stages. Don't use this in prodcution.

# How do develop

Start the typescript compiler in watch mode

```bash
yarn watch
```

Run tests

```bash
docker-compose up -d
yarn test
```

## Correct conversion of float values

Javascript number has some limitations since it's using IEEE 754 standard to encode all numbers

In some use cases you need a different type than number to store floating point values.
pg offers a method to manipulate how database types are mapped to an result object

The default behaviour is to convert all floating point values to string.

so if you query something like `select avg(salary) from persons` you'll get a string as a result.
usually that is not the expected behaviour

just use this snippet before connecting to the databse to convert all floating point values to number

```ts
import pg from 'pg';

pg.types.setTypeParser(pg.types.builtins.FLOAT4, parseFloat);
pg.types.setTypeParser(pg.types.builtins.FLOAT8, parseFloat);
pg.types.setTypeParser(pg.types.builtins.NUMERIC, parseFloat);
```

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