From f2bc231a109bf06390e1ca6080e5ab11b783dacc Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Wed, 11 Jun 2025 14:41:27 +0200 Subject: [PATCH] feat: structured queries --- snakemake_interface_storage_plugins/query.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 snakemake_interface_storage_plugins/query.py diff --git a/snakemake_interface_storage_plugins/query.py b/snakemake_interface_storage_plugins/query.py new file mode 100644 index 0000000..f6f2b32 --- /dev/null +++ b/snakemake_interface_storage_plugins/query.py @@ -0,0 +1,18 @@ +from abc import ABC, abstractmethod +from dataclasses import dataclass +from typing import List + + +@dataclass +class QueryBase: + """Base class for structured queries. + + By implementing the `to_str` method, subclasses can define how the query + should be represented as a string or list of strings, representing individual + queries. + """ + # TODO determine how to auto-handle to and from str conversion + # how to handle wildcards, and how to handle single queries representing multiple + # individual queries. For the latter, can we use the same type or should we + # use a different type? + def to_str(self) -> List[str]: ... \ No newline at end of file