Skip to content

Commit

Permalink
docs: generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Feb 18, 2019
1 parent 40471ca commit e4ff129
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,13 @@ await pool.query(sql`SELECT 1`);
<a name="slonik-usage-default-configuration"></a>
### Default configuration

[Field name transformation interceptor](#field-name-transformation-interceptor) and [Query normalization interceptor](#query-normalization-interceptor) are enabled by default.
<a name="slonik-usage-default-configuration-default-interceptors"></a>
#### Default interceptors

These interceptors are enabled by default:

* [Field name transformation interceptor](#field-name-transformation-interceptor)
* [Query normalization interceptor](#query-normalization-interceptor)

To disable the default interceptors, pass an empty array, e.g.

Expand All @@ -485,6 +491,21 @@ createPool('postgres://', {

```

You can create default interceptor collection using `createInterceptorPreset`, e.g.

```js
import {
createInterceptorPreset
} from 'slonik';

createPool('postgres://', {
interceptors: [
...createInterceptorPreset()
]
});

```

<a name="slonik-usage-checking-out-a-client-from-the-connection-pool"></a>
### Checking out a client from the connection pool

Expand Down Expand Up @@ -558,7 +579,7 @@ Work on `pg-promise` began [Wed Mar 4 02:00:34 2015](https://github.com/vitaly-t

Functionality can be added to Slonik client by adding interceptors (middleware).

Interceptors are configured using [client configuration](#slonik-usage-configuration), e.g.
Interceptors are configured using [client configuration](#api), e.g.

```js
import {
Expand All @@ -575,6 +596,8 @@ const connection = createPool('postgres://', {

Interceptors are executed in the order they are added.

Read: [Default interceptors](#default-interceptors).

<a name="slonik-interceptors-interceptor-methods"></a>
### Interceptor methods

Expand Down

0 comments on commit e4ff129

Please sign in to comment.