Comparing version 0.2.24 to 0.2.25
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "0.2.24", | ||
"version": "0.2.25", | ||
"type": "module", | ||
@@ -37,3 +37,3 @@ "main": "./index.js", | ||
"rimraf": "^5.0.1", | ||
"typescript": "^5.1.3", | ||
"typescript": "^5.1.5", | ||
"uuid": "^9.0.0" | ||
@@ -40,0 +40,0 @@ }, |
@@ -66,25 +66,4 @@ <!-- ![code](/assets/code.webp 'code') --> | ||
## Configure | ||
--- | ||
A default querier-pool can be set in any of the bootstrap files of your app (e.g. in the `server.ts`). | ||
```ts | ||
import { setQuerierPool } from 'nukak'; | ||
import { PgQuerierPool } from 'nukak-postgres'; | ||
export const querierPool = new PgQuerierPool( | ||
{ | ||
host: 'localhost', | ||
user: 'theUser', | ||
password: 'thePassword', | ||
database: 'theDatabase', | ||
}, | ||
// optionally, a logger can be passed to log the generated SQL queries | ||
{ logger: console.log } | ||
); | ||
// the default querier pool that `nukak` will use | ||
setQuerierPool(querierPool); | ||
``` | ||
| ||
@@ -131,2 +110,27 @@ | ||
## Setup a default querier-pool | ||
A default querier-pool can be set in any of the bootstrap files of your app (e.g. in the `server.ts`). | ||
```ts | ||
import { setQuerierPool } from 'nukak'; | ||
import { PgQuerierPool } from 'nukak-postgres'; | ||
export const querierPool = new PgQuerierPool( | ||
{ | ||
host: 'localhost', | ||
user: 'theUser', | ||
password: 'thePassword', | ||
database: 'theDatabase', | ||
}, | ||
// optionally, a logger can be passed to log the generated SQL queries | ||
{ logger: console.log } | ||
); | ||
// the default querier pool that `nukak` will use | ||
setQuerierPool(querierPool); | ||
``` | ||
| ||
## Manipulate the data | ||
@@ -138,3 +142,3 @@ | ||
async function findLastUsers(limit = 10) { | ||
async function findFirstUsers(limit = 100) { | ||
const querier = await getQuerier(); | ||
@@ -144,3 +148,3 @@ const users = await querier.findMany( | ||
{ | ||
$sort: { createdAt: -1 }, | ||
$sort: { createdAt: 1 }, | ||
$limit: limit, | ||
@@ -147,0 +151,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
287594
165