Open lmolkova opened 1 month ago
Discussed at DB SIG call, decided to rename collection to target and wider its scope.
Related:
if we don't go ahead with #1527, we may also consider introducing something like db.stored_procedure.name
I don't think I've worked with "named" prepared statements, do you have an example of that? thanks
Microsoft SQL Server returns an integer handle that isn't worth recording IMO. I believe SQLite does something similar.
MySQL, MariaDB, and PostgresSQL support named prepared statements. Invocation is similar to stored procedures.
mysql> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
mysql> SET @a = 3;
mysql> SET @b = 4;
mysql> EXECUTE stmt1 USING @a, @b;
+------------+
| hypotenuse |
+------------+
| 5 |
+------------+
mysql> DEALLOCATE PREPARE stmt1;
PREPARE fooplan (int, text, bool, numeric) AS
INSERT INTO foo VALUES($1, $2, $3, $4);
EXECUTE fooplan(1, 'Hunter Valley', 't', 200.00);
See https://github.com/open-telemetry/semantic-conventions/pull/1482#discussion_r1805142038
E.g. query like
CALL procedure-name
should result in the following attributes:db.query.text = "CALL procedure-name"
db.operation.name = "CALL"
db.collection.name = "procedure-name"
We should document that collection name can contain stored procedure/prepared statement name