import codecs
import string
+from abc import ABC, abstractmethod
from typing import Any, Iterator, List, Optional, Sequence, Union
from .pq import Escaping
return Literal(obj).as_string(context)
-class Composable:
+class Composable(ABC):
"""
Abstract base class for objects that can be used to compose an SQL string.
def __repr__(self) -> str:
return f"{self.__class__.__name__}({self._obj!r})"
+ @abstractmethod
def as_bytes(self, context: Optional[AdaptContext]) -> bytes:
"""
Return the value of the object as bytes.