Skip to content

Commit c6b0348

Browse files
author
Artyom Abakumov
committed
Add ability to specify plugins names for user trace session
1 parent 44e4579 commit c6b0348

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/firebird/driver/core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5496,12 +5496,13 @@ def __action(self, action: ServerAction, label: str, session_id: int) -> str:
54965496
# response should contain the error message
54975497
raise DatabaseError(response)
54985498
return response
5499-
def start(self, *, config: str, name: str | None=None) -> int:
5499+
def start(self, *, config: str, name: str | None=None, plugins: str | list[str] | None) -> int:
55005500
"""Start new trace session. **(ASYNC service)**
55015501
55025502
Arguments:
55035503
config: Trace session configuration.
55045504
name: Trace session name.
5505+
plugins: Plugins to use for the session (only for FIREBIRD 6+)
55055506
55065507
Returns:
55075508
Trace session ID.
@@ -5511,6 +5512,11 @@ def start(self, *, config: str, name: str | None=None) -> int:
55115512
spb.insert_tag(ServerAction.TRACE_START)
55125513
if name is not None:
55135514
spb.insert_string(SrvTraceOption.NAME, name)
5515+
if plugins is not None:
5516+
if isinstance(plugins, list):
5517+
plugins = ",".join(plugins)
5518+
spb.insert_string(SrvTraceOption.PLUGINS, plugins)
5519+
55145520
spb.insert_string(SrvTraceOption.CONFIG, config, encoding=self._srv().encoding)
55155521
self._srv()._svc.start(spb.get_buffer())
55165522
response = self._srv()._fetch_line()

src/firebird/driver/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ class SrvTraceOption(IntEnum):
830830
ID = 1
831831
NAME = 2
832832
CONFIG = 3
833+
PLUGINS = 4
833834

834835
class SrvPropertiesOption(IntEnum):
835836
"""Parameters for ServerAction.PROPERTIES.

0 commit comments

Comments
 (0)