66
77# Class: ` abstract ` PgRunner\< TTable, TInput, TOutput\>
88
9- Defined in: [ src/pg/PgRunner.ts:51 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L51 )
9+ Defined in: [ src/pg/PgRunner.ts:52 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L52 )
1010
1111A convenient pile of helper methods usable by most of PgQuery* classes. In
1212some sense it's an anti-pattern, but still reduces the boilerplate.
3333
3434> ** new PgRunner** \< ` TTable ` , ` TInput ` , ` TOutput ` \> (` schema ` , ` client ` ): [ ` PgRunner ` ] ( PgRunner.md ) \< ` TTable ` , ` TInput ` , ` TOutput ` \>
3535
36- Defined in: [ src/pg/PgRunner.ts:503 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L503 )
36+ Defined in: [ src/pg/PgRunner.ts:504 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L504 )
3737
3838#### Parameters
3939
@@ -145,7 +145,7 @@ into one input; e.g. this is needed for inserts).
145145
146146> ` protected ` ** clientQuery** \< ` TOutput ` \> (` sql ` , ` annotations ` , ` batchFactor ` , ` hints ` ?): ` Promise ` \< ` TOutput ` [ ] \>
147147
148- Defined in: [ src/pg/PgRunner.ts:65 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L65 )
148+ Defined in: [ src/pg/PgRunner.ts:66 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L66 )
149149
150150#### Type Parameters
151151
@@ -160,7 +160,7 @@ Defined in: [src/pg/PgRunner.ts:65](https://github.com/clickup/ent-framework/blo
160160| ` sql ` | ` string ` |
161161| ` annotations ` | [ ` QueryAnnotation ` ] ( ../interfaces/QueryAnnotation.md ) [ ] |
162162| ` batchFactor ` | ` number ` |
163- | ` hints ` ? | ` Record ` \< ` string ` , ` string ` \> |
163+ | ` hints ` ? | [ ` Hints ` ] ( ../type-aliases/Hints.md ) |
164164
165165#### Returns
166166
@@ -172,7 +172,7 @@ Defined in: [src/pg/PgRunner.ts:65](https://github.com/clickup/ent-framework/blo
172172
173173> ` protected ` ** fmt** (` template ` , ` args ` ): ` string `
174174
175- Defined in: [ src/pg/PgRunner.ts:104 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L104 )
175+ Defined in: [ src/pg/PgRunner.ts:105 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L105 )
176176
177177Formats prefixes/suffixes of various compound SQL clauses. Don't use on
178178performance-critical path!
@@ -196,7 +196,7 @@ performance-critical path!
196196
197197> ` protected ` ** escapeValue** (` field ` , ` value ` ): ` string `
198198
199- Defined in: [ src/pg/PgRunner.ts:170 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L170 )
199+ Defined in: [ src/pg/PgRunner.ts:171 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L171 )
200200
201201Escapes a value at runtime using the codegen functions created above. We
202202use escapers table and the codegen for the following reasons:
@@ -222,7 +222,7 @@ use escapers table and the codegen for the following reasons:
222222
223223> ` protected ` ** escapeField** (` info ` , ` __namedParameters ` ): ` string `
224224
225- Defined in: [ src/pg/PgRunner.ts:183 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L183 )
225+ Defined in: [ src/pg/PgRunner.ts:184 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L184 )
226226
227227Escapes field name identifier.
228228- In case it's a composite primary key, returns its ` ROW(f1,f2,...) `
@@ -250,7 +250,7 @@ Escapes field name identifier.
250250
251251> ` protected ` ** createWithBuilder** (` __namedParameters ` ): ` object `
252252
253- Defined in: [ src/pg/PgRunner.ts:221 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L221 )
253+ Defined in: [ src/pg/PgRunner.ts:222 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L222 )
254254
255255Returns a newly created JS function which, when called with a row set,
256256returns the following SQL clause:
@@ -308,7 +308,7 @@ of columns is passed in specs.
308308
309309> ` protected ` ** createValuesBuilder** \< ` TInput ` \> (` __namedParameters ` ): ` object `
310310
311- Defined in: [ src/pg/PgRunner.ts:289 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L289 )
311+ Defined in: [ src/pg/PgRunner.ts:290 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L290 )
312312
313313Returns a newly created JS function which, when called with a row set,
314314returns the following SQL clause (when called with withKey=true):
@@ -391,7 +391,7 @@ generate VALUES clause without exact identification of the destination.
391391
392392> ` protected ` ** createUpdateKVsBuilder** (` fields ` ): (` input ` , ` literal ` ?) => ` string `
393393
394- Defined in: [ src/pg/PgRunner.ts:360 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L360 )
394+ Defined in: [ src/pg/PgRunner.ts:361 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L361 )
395395
396396Returns a newly created JS function which, when called with an object,
397397returns the following SQL clause:
@@ -427,7 +427,7 @@ The set of columns is passed in specs, all other columns are ignored.
427427
428428> ` protected ` ** createOneOfBuilder** (` field ` , ` fieldValCode ` ): (` values ` ) => ` string `
429429
430- Defined in: [ src/pg/PgRunner.ts:388 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L388 )
430+ Defined in: [ src/pg/PgRunner.ts:389 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L389 )
431431
432432Prefers to do utilize createAnyBuilder() if it can (i.e. build
433433a=ANY('{...}') clause). Otherwise, builds an IN(...) clause.
@@ -459,7 +459,7 @@ a=ANY('{...}') clause). Otherwise, builds an IN(...) clause.
459459
460460> ` protected ` ** createWhereBuildersFieldsEq** \< ` TInput ` \> (` args ` ): ` object `
461461
462- Defined in: [ src/pg/PgRunner.ts:422 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L422 )
462+ Defined in: [ src/pg/PgRunner.ts:423 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L423 )
463463
464464Given a list of fields, returns two builders:
465465
@@ -558,7 +558,7 @@ WHERE (field1='a' AND field2='b' AND field3 IN('a', 'b', 'c', ...)) OR (...)
558558
559559> ` protected ` ** createWhereBuilder** (` __namedParameters ` ): ` object `
560560
561- Defined in: [ src/pg/PgRunner.ts:457 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L457 )
561+ Defined in: [ src/pg/PgRunner.ts:458 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L458 )
562562
563563Returns a newly created JS function which, when called with a Where object,
564564returns the generated SQL WHERE clause.
@@ -607,7 +607,7 @@ returns the generated SQL WHERE clause.
607607
608608> ` protected ` ** addPK** (` fields ` , ` mode ` ): ` string ` [ ]
609609
610- Defined in: [ src/pg/PgRunner.ts:492 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L492 )
610+ Defined in: [ src/pg/PgRunner.ts:493 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L493 )
611611
612612Prepends or appends a primary key to the list of fields. In case the
613613primary key is plain (i.e. "id" field), it's just added as a field;
@@ -641,7 +641,7 @@ transactions. This lowers the chances of deadlocks too.
641641
642642> ** delayForSingleQueryRetryOnError** (` e ` ): ` number ` \| ` "immediate_retry" ` \| ` "no_retry" `
643643
644- Defined in: [ src/pg/PgRunner.ts:525 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L525 )
644+ Defined in: [ src/pg/PgRunner.ts:526 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L526 )
645645
646646If the single query's error needs to be retried (e.g. it's a deadlock
647647error), returns the number of milliseconds to wait before retrying.
@@ -666,7 +666,7 @@ error), returns the number of milliseconds to wait before retrying.
666666
667667> ** shouldDebatchOnError** (` e ` ): ` boolean `
668668
669- Defined in: [ src/pg/PgRunner.ts:538 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L538 )
669+ Defined in: [ src/pg/PgRunner.ts:539 ] ( https://github.com/clickup/ent-framework/blob/master/src/pg/PgRunner.ts#L539 )
670670
671671If this method returns true for an error object, the batch is split back
672672into sub-queries, they are executed individually, and then the response of
0 commit comments