@@ -5067,6 +5067,41 @@ describe('Spanner with mock server', () => {
50675067 assert . strictEqual ( commitRequest . mutations . length , 2 ) ;
50685068 } ) ;
50695069
5070+ it ( 'should execute deleteRows with various key types' , async ( ) => {
5071+ const database = newTestDatabase ( ) ;
5072+ const mutations = new MutationSet ( ) ;
5073+
5074+ // define different types of keys
5075+ const intKey = 123 ;
5076+ const boolKey = true ;
5077+ const floatKey = 3.14 ;
5078+ const bytesKey = Buffer . from ( 'test-buffer' ) ;
5079+ const dateKey = new SpannerDate ( '2023-09-22' ) ;
5080+ const timestampKey = new PreciseDate ( '2023-09-22T10:00:00.123Z' ) ;
5081+ const numericKey = new Numeric ( '123.456' ) ;
5082+
5083+ // queue deletes for each type
5084+ mutations . deleteRows ( 'IntTable' , [ intKey ] ) ;
5085+ mutations . deleteRows ( 'BoolTable' , [ boolKey ] ) ;
5086+ mutations . deleteRows ( 'FloatTable' , [ floatKey ] ) ;
5087+ mutations . deleteRows ( 'BytesTable' , [ bytesKey ] ) ;
5088+ mutations . deleteRows ( 'DateTable' , [ dateKey ] ) ;
5089+ mutations . deleteRows ( 'TimestampTable' , [ timestampKey ] ) ;
5090+ mutations . deleteRows ( 'NumericTable' , [ numericKey ] ) ;
5091+
5092+ // execute blind writes
5093+ await database . writeAtLeastOnce ( mutations , { } ) ;
5094+
5095+ // get the request sent to mock server
5096+ const request = spannerMock . getRequests ( ) . find ( val => {
5097+ return ( val as v1 . CommitRequest ) . mutations ;
5098+ } ) as v1 . CommitRequest ;
5099+
5100+ assert . strictEqual ( request . mutations ! . length , 7 ) ;
5101+
5102+ await database . close ( ) ;
5103+ } ) ;
5104+
50705105 it ( 'should apply blind writes only once with isolationLevel option' , async ( ) => {
50715106 const database = newTestDatabase ( ) ;
50725107 const mutations = new MutationSet ( ) ;
0 commit comments