Back to Node Mysql2

Prepared Statements

website/docs/examples/queries/prepared-statements/index.mdx

3.22.3745 B
Original Source

Prepared Statements

MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods.

See detailed documentaion in Prepared Statements.

:::tip If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. :::

<hr />

Usage examples: