-
-
Notifications
You must be signed in to change notification settings - Fork 628
/
Copy pathexecute.ts
38 lines (31 loc) · 959 Bytes
/
execute.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { mysql } from '../../../index.js';
import { access, sql, sqlPS, values } from '../../baseConnection.js';
(async () => {
const db = mysql.createConnection(access).promise();
{
/** Overload: execute(sql) */
const [results, fields] = await db.execute(sql);
console.log(results, fields);
}
{
/** Overload: execute(sql, values) */
const [results, fields] = await db.execute(sqlPS, values);
console.log(results, fields);
}
{
/** Overload: execute(QueryOptions) I */
const [results, fields] = await db.execute({ sql });
console.log(results, fields);
}
{
/** Overload: execute(QueryOptions) II */
const [results, fields] = await db.execute({ sql: sqlPS, values });
console.log(results, fields);
}
{
/** Overload: execute(QueryOptions, values) */
const [results, fields] = await db.execute({ sql: sqlPS }, values);
console.log(results, fields);
}
await db.end();
})();