1717 */
1818
1919import type { Duration } from "./datatypes/datetime" ;
20+ import type { Codecs } from "./codecs/codecs" ;
2021import { CodecsRegistry } from "./codecs/registry" ;
2122import type {
2223 ConnectArgumentsParser ,
@@ -35,7 +36,6 @@ import {
3536} from "./ifaces" ;
3637import type {
3738 RetryOptions ,
38- Session ,
3939 SimpleRetryOptions ,
4040 SimpleTransactionOptions ,
4141 TransactionOptions ,
@@ -190,7 +190,7 @@ export class ClientConnectionHolder {
190190 args ,
191191 outputFormat ,
192192 expectedCardinality ,
193- this . options . session ,
193+ this . options ,
194194 false /* privilegedMode */ ,
195195 language ,
196196 ) ;
@@ -581,34 +581,24 @@ export class Client implements Executor {
581581 return new Client ( this . pool , this . options . withRetryOptions ( opts ) ) ;
582582 }
583583
584- withSession ( session : Session ) : Client {
585- return new Client ( this . pool , this . options . withSession ( session ) ) ;
586- }
587-
588584 withModuleAliases ( aliases : Record < string , string > ) {
589- return new Client (
590- this . pool ,
591- this . options . withSession ( this . options . session . withModuleAliases ( aliases ) ) ,
592- ) ;
585+ return new Client ( this . pool , this . options . withModuleAliases ( aliases ) ) ;
593586 }
594587
595588 withConfig ( config : SimpleConfig ) : Client {
596- const newConfig = this . options . session . withConfig ( config ) ;
597- return new Client ( this . pool , this . options . withSession ( newConfig ) ) ;
589+ return new Client ( this . pool , this . options . withConfig ( config ) ) ;
590+ }
591+
592+ withCodecs ( codecs : Codecs . CodecSpec ) : Client {
593+ return new Client ( this . pool , this . options . withCodecs ( codecs ) ) ;
598594 }
599595
600596 withGlobals ( globals : Record < string , any > ) : Client {
601- return new Client (
602- this . pool ,
603- this . options . withSession ( this . options . session . withGlobals ( globals ) ) ,
604- ) ;
597+ return new Client ( this . pool , this . options . withGlobals ( globals ) ) ;
605598 }
606599
607600 withQueryTag ( tag : string | null ) : Client {
608- return new Client (
609- this . pool ,
610- this . options . withSession ( this . options . session . withQueryTag ( tag ) ) ,
611- ) ;
601+ return new Client ( this . pool , this . options . withQueryTag ( tag ) ) ;
612602 }
613603
614604 withWarningHandler ( handler : WarningHandler ) : Client {
@@ -775,7 +765,7 @@ export class Client implements Executor {
775765 query ,
776766 OutputFormat . BINARY ,
777767 Cardinality . MANY ,
778- this . options . session ,
768+ this . options ,
779769 ) ;
780770 const cardinality = util . parseCardinality ( result [ 0 ] ) ;
781771
0 commit comments