0.2.4 • Published 19 days ago

jooq.ts v0.2.4

Weekly downloads
354
License
MIT
Repository
github
Last release
19 days ago

tsooq

This project aims to provide a replacement for jOOQ 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

yarn watch

Run tests

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

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);
0.2.4

19 days ago

0.2.3

3 months ago

0.2.1

5 months ago

0.2.2

5 months ago

0.2.0

2 years ago

0.1.40

2 years ago

0.1.39

2 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.1.38

3 years ago

0.1.34

3 years ago

0.1.31

3 years ago

0.1.32

3 years ago

0.1.33

3 years ago

0.1.30

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.26

3 years ago

0.1.25

3 years ago

0.1.24

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.17

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.1.0

3 years ago