S
S
Siple2017-07-07 00:44:56
MySQL
Siple, 2017-07-07 00:44:56

Node.js mysql - what is the difference between query and execute?

Hello. What is the difference between connection.query('SELECT...') and connection.execute('SELECT...') and also createConnection from createPool using mysql2/promise (ES7 Async Await)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-07-07
@Siple

What is the difference between connection.query and connection.execute

execute = prepare + query
When substituting variables into a query, query without prepare results in SQL injection.
RFTM https://github.com/sidorares/node-mysql2#using-pre...
One connection or many (to speed up parallel requests)
RTFM https://github.com/mysqljs/mysql#pooling-connections

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question