@@ -149,19 +149,22 @@ Calls swallowedErrorLogger() doing some preliminary amendment.
149149
150150### batcher()
151151
152- > ** batcher** \< ` TInput ` , ` TOutput ` , ` TTable ` \> (` _QueryClass ` , ` _schema ` , ` _additionalShape ` , ` runnerCreator ` ): [ ` Batcher ` ] ( Batcher.md ) \< ` TInput ` , ` TOutput ` \>
152+ > ** batcher** \< ` TInput ` , ` TOutput ` , ` TTable ` \> (` _QueryClass ` , ` _schema ` , ` _additionalShape ` , ` disableBatching ` , ` runnerCreator ` ): [ ` Batcher ` ] ( Batcher.md ) \< ` TInput ` , ` TOutput ` \>
153153
154- Defined in: [ src/abstract/Client.ts:179] ( https://github.com/clickup/ent-framework/blob/master/src/abstract/Client.ts#L179 )
154+ Defined in: [ src/abstract/Client.ts:182] ( https://github.com/clickup/ent-framework/blob/master/src/abstract/Client.ts#L182 )
155+
156+ Batcher is per-Client per-query-type
157+ per-table-name-and-shape-and-disableBatching:
155158
156- Batcher is per-Client per-query-type per-table-name-and-shape:
157159- Per-Client means that batchers are removed as soon as the Client is
158160 removed, i.e. the Client owns all the batchers for all tables.
159161- Per-query-type means that the batcher for a SELECT query is different
160162 from the batcher for an INSERT query (obviously).
161- - Per-table-name-and-shape means that each table has its own set of
162- batchers (obviously). Also, some queries may be complex (like UPDATE), so
163- the batcher also depends on the "shape" - the list of fields we're
164- updating.
163+ - Per-table-name-and-shape-and-disableBatching means that each table has
164+ its own set of batchers (obviously). Also, some queries may be complex
165+ (like UPDATE), so the batcher also depends on the "shape" - the list of
166+ fields we're updating. Plus, for some inputs, we want to disable batching
167+ at all - that produces a separate Batcher instance.
165168
166169Also, for every Batcher, there is exactly one Runner (which knows how to
167170build the actual query in the context of the current Client). Batchers are
@@ -186,6 +189,7 @@ All that means that in a 1000-Shard 20-table Cluster we'll eventually have
186189| ` _QueryClass ` | ` Function ` |
187190| ` _schema ` | [ ` Schema ` ] ( Schema.md ) \< ` TTable ` , [ ` UniqueKey ` ] ( ../type-aliases/UniqueKey.md ) \< ` TTable ` \>\> |
188191| ` _additionalShape ` | ` string ` |
192+ | ` disableBatching ` | ` boolean ` |
189193| ` runnerCreator ` | () => [ ` Runner ` ] ( Runner.md ) \< ` TInput ` , ` TOutput ` \> |
190194
191195#### Returns
@@ -202,7 +206,7 @@ All that means that in a 1000-Shard 20-table Cluster we'll eventually have
202206
203207> ** prewarm** (): ` void `
204208
205- Defined in: [ src/abstract/Client.ts:199 ] ( https://github.com/clickup/ent-framework/blob/master/src/abstract/Client.ts#L199 )
209+ Defined in: [ src/abstract/Client.ts:207 ] ( https://github.com/clickup/ent-framework/blob/master/src/abstract/Client.ts#L207 )
206210
207211A convenience method to put connections prewarming logic to. The idea is to
208212keep the needed number of open connections and also, in each connection,
@@ -305,7 +309,7 @@ should expect that role() returns the actual master/replica role.
305309
306310> ** shardNos** (): ` Promise ` \< readonly ` number ` [ ] \>
307311
308- Defined in: [ src/pg/PgClient.ts:402 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L402 )
312+ Defined in: [ src/pg/PgClient.ts:408 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L408 )
309313
310314Returns all Shard numbers discoverable via the connection to the Client's
311315database.
@@ -324,7 +328,7 @@ database.
324328
325329> ** ping** (` __namedParameters ` ): ` Promise ` \< ` void ` \>
326330
327- Defined in: [ src/pg/PgClient.ts:426 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L426 )
331+ Defined in: [ src/pg/PgClient.ts:432 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L432 )
328332
329333Sends a read or write test query to the server. Tells the server to sit and
330334wait for at least the provided number of milliseconds.
@@ -349,7 +353,7 @@ wait for at least the provided number of milliseconds.
349353
350354> ** shardNoByID** (` id ` ): ` number `
351355
352- Defined in: [ src/pg/PgClient.ts:444 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L444 )
356+ Defined in: [ src/pg/PgClient.ts:450 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L450 )
353357
354358Extracts Shard number from an ID.
355359
@@ -373,7 +377,7 @@ Extracts Shard number from an ID.
373377
374378> ** withShard** (` no ` ): ` this `
375379
376- Defined in: [ src/pg/PgClient.ts:500 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L500 )
380+ Defined in: [ src/pg/PgClient.ts:506 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L506 )
377381
378382Creates a new Client which is namespaced to the provided Shard number. The
379383new Client will share the same connection pool with the parent's Client.
@@ -398,7 +402,7 @@ new Client will share the same connection pool with the parent's Client.
398402
399403> ** role** (): [ ` ClientRole ` ] ( ../type-aliases/ClientRole.md )
400404
401- Defined in: [ src/pg/PgClient.ts:511 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L511 )
405+ Defined in: [ src/pg/PgClient.ts:517 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L517 )
402406
403407Returns the Client's role reported after the last successful query. Master
404408and replica roles may switch online unpredictably, without reconnecting, so
@@ -418,7 +422,7 @@ we only know the role after a query.
418422
419423> ** connectionIssue** (): ` null ` \| [ ` ClientConnectionIssue ` ] ( ../interfaces/ClientConnectionIssue.md )
420424
421- Defined in: [ src/pg/PgClient.ts:515 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L515 )
425+ Defined in: [ src/pg/PgClient.ts:521 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgClient.ts#L521 )
422426
423427Returns a non-nullable value if the Client couldn't connect to the server
424428(or it could, but the load balancer reported the remote server as not
0 commit comments