What is the proper way to use `Transaction` with multiple prepared queries
See original GitHub issueI’m trying to create a transaction of multiple prepared statements inside
- It’s TypeScript code:
const request = new Request (transaction ? transaction : pool);
/* or */
const stmt = new PreparedStatement(transaction ? transaction : pool);
const query = ``;
TS compiler complaints about Request
can’t get ConnectionPool | Transaction
type. So I can’t continue to develop because of these errors
- I can’t find proper examples in the docs of using transactions with multiple prepared statements And maybe TS examples
- NodeJS: 12.8
- node-mssql: 5.1.0
- msnodesqlv8: 0.8.3
- SQL Server: 16
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Using Prepared Statements - JDBC Basics - Oracle Help Center
This JDBC Java tutorial describes how to use JDBC API to create, insert into, update, and query tables. You will also learn how...
Read more >php - PDO: How can I run multiple prepared statements in a ...
Examine the storage engine for the table you are trying to perform transactions on to ensure that it in fact supports transactions.
Read more >Multi-statement transactions | BigQuery - Google Cloud
A multi-statement transaction lets you perform mutating operations, such as inserting or deleting rows on one or more tables, and either commit or...
Read more >Using Prepared Statements - Go database/sql tutorial
To use a prepared statement prepared outside the transaction in a Tx , you can use Tx.Stmt() , which will create a new...
Read more >How to execute 1000s INSERT/UPDATE queries with PDO?
The key to have your multiple inserts fast and reliable is to use **transactions** and a **prepared statement**.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, I’ll block the TS complaining and try it If it succeeds, I’ll send a PR to docs with an example Thanks
closing this as stale