Azure function node js multi-request sql server transaction mssql
Budget: $30 – $250 AUD
I need an azure function, written in NodeJS (typescript) that when the endpoint is requested, performs 3 writes to an azure sql database inside a single transaction using the mssql package.
More specifically, when the endpoint is requested, a function
writeToDb(rowsArray, rowId, rowObj) is called
The function takes in 3 arguments for each of the separate write operations:
rowsArray - an array of objects to be bulk inserted into Table A. Each object is structured to match the columns of Table A
rowId - an integer which is the primary key id of a row in Table B that is to be updated (one of the columns will switch from true to false)
rowObj - an object whose structure matches the rows of Table B to be inserted into Table B
Each request will be placed in a transaction so that if one request fails, the whole transaction is rolled back.
The response is sent to the client with either a result of 200, success… Or 400 and error description (which transaction failed)
More specifically, when the endpoint is requested, a function
writeToDb(rowsArray, rowId, rowObj) is called
The function takes in 3 arguments for each of the separate write operations:
rowsArray - an array of objects to be bulk inserted into Table A. Each object is structured to match the columns of Table A
rowId - an integer which is the primary key id of a row in Table B that is to be updated (one of the columns will switch from true to false)
rowObj - an object whose structure matches the rows of Table B to be inserted into Table B
Each request will be placed in a transaction so that if one request fails, the whole transaction is rolled back.
The response is sent to the client with either a result of 200, success… Or 400 and error description (which transaction failed)