1- import { DatabaseConnection , QueryResult } from "kysely" ;
2- import { Driver } from "kysely" ;
3- import { CompiledQuery } from "kysely" ;
4- import RDSDataService , { SqlParametersList } from "aws-sdk/clients/rdsdataservice.js" ;
1+ import { RDSData , SqlParameter } from "@aws-sdk/client-rds-data" ;
2+ import { CompiledQuery , DatabaseConnection , Driver , QueryResult } from "kysely" ;
53
64export type DataApiDriverConfig = {
7- client : RDSDataService ;
5+ client : RDSData ;
86 secretArn : string ;
97 resourceArn : string ;
108 database : string ;
@@ -60,8 +58,7 @@ class DataApiConnection implements DatabaseConnection {
6058 secretArn : this . #config. secretArn ,
6159 resourceArn : this . #config. resourceArn ,
6260 database : this . #config. database ,
63- } )
64- . promise ( ) ;
61+ } ) ;
6562 this . #transactionId = r . transactionId ;
6663 }
6764
@@ -73,8 +70,7 @@ class DataApiConnection implements DatabaseConnection {
7370 secretArn : this . #config. secretArn ,
7471 resourceArn : this . #config. resourceArn ,
7572 transactionId : this . #transactionId,
76- } )
77- . promise ( ) ;
73+ } ) ;
7874 }
7975
8076 public async rollbackTransaction ( ) {
@@ -85,8 +81,7 @@ class DataApiConnection implements DatabaseConnection {
8581 secretArn : this . #config. secretArn ,
8682 resourceArn : this . #config. resourceArn ,
8783 transactionId : this . #transactionId,
88- } )
89- . promise ( ) ;
84+ } ) ;
9085 }
9186
9287 async executeQuery < O > ( compiledQuery : CompiledQuery ) : Promise < QueryResult < O > > {
@@ -96,11 +91,10 @@ class DataApiConnection implements DatabaseConnection {
9691 secretArn : this . #config. secretArn ,
9792 resourceArn : this . #config. resourceArn ,
9893 sql : compiledQuery . sql ,
99- parameters : compiledQuery . parameters as SqlParametersList ,
94+ parameters : compiledQuery . parameters as SqlParameter [ ] ,
10095 database : this . #config. database ,
10196 includeResultMetadata : true ,
102- } )
103- . promise ( ) ;
97+ } ) ;
10498 if ( ! r . columnMetadata ) {
10599 return {
106100 numUpdatedOrDeletedRows : BigInt ( r . numberOfRecordsUpdated || 0 ) ,
0 commit comments