pyracmon.dbapi API documentation
Description: This module provides interfaces defined in DB-API 2.0.

# Module `pyracmon.dbapi`

This module provides interfaces defined in DB-API 2.0.

Expand source code

    """
    This module provides interfaces defined in DB-API 2.0.
    """
    from typing import Protocol, Any, Optional
    from collections.abc import Sequence

    class Cursor(Protocol):
        @property
        def description(self) -> str: ...
        @property
        def rowcount(self) -> int: ...
        @property
        def arraysize(self) -> int: ...

        #def callproc(self, procname: str, *args, **kwargs) -> Any: ...
        #def nextset(self) -> bool: ...
        def close(self) -> None: ...
        def execute(self, operation: str, *args, **kwargs) -> Any: ...
        def executemany(self, operation: str, seq_of_parameters: Sequence[Any]) -> Any: ...
        def fetchone(self) -> Optional[Sequence[Any]]: ...
        def fetchmany(self, size: int = 0) -> Sequence[Sequence[Any]]: ...
        def fetchall(self) -> Sequence[Sequence[Any]]: ...
        def setinputsizes(self, sizes: Sequence[Any]): ...
        def setoutputsize(self, size: int, column: int): ...

    class Connection(Protocol):
        def close(self) -> None: ...
        def commit(self) -> None: ...
        def rollback(self) -> None: ...
        def cursor(self) -> Cursor: ...

## Classes

`class Connection (*args, **kwargs)`

  Base class for protocol classes.

  Protocol classes are defined as::

      class Proto(Protocol):
          def meth(self) -> int:
              ...

  Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example::

      class C:
          def meth(self) -> int:
              return 0

      def func(x: Proto) -> int:
          return x.meth()

      func(C())  # Passes static type check

  See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as::

      class GenProto(Protocol[T]):
          def meth(self) -> T:
              ...

  Expand source code

      class Connection(Protocol):
          def close(self) -> None: ...
          def commit(self) -> None: ...
          def rollback(self) -> None: ...
          def cursor(self) -> Cursor: ...

  ### Ancestors

  - typing.Protocol
  - typing.Generic

  ### Subclasses

  - Connection

  ### Methods

  `def close(self) ‑> None`
    Expand source code

        def close(self) -> None: ...

  `def commit(self) ‑> None`
    Expand source code

        def commit(self) -> None: ...

  `def cursor(self) ‑> Cursor`
    Expand source code

        def cursor(self) -> Cursor: ...

  `def rollback(self) ‑> None`
    Expand source code

        def rollback(self) -> None: ...

`class Cursor (*args, **kwargs)`

  Base class for protocol classes.

  Protocol classes are defined as::

      class Proto(Protocol):
          def meth(self) -> int:
              ...

  Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example::

      class C:
          def meth(self) -> int:
              return 0

      def func(x: Proto) -> int:
          return x.meth()

      func(C())  # Passes static type check

  See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as::

      class GenProto(Protocol[T]):
          def meth(self) -> T:
              ...

  Expand source code

      class Cursor(Protocol):
          @property
          def description(self) -> str: ...
          @property
          def rowcount(self) -> int: ...
          @property
          def arraysize(self) -> int: ...

          #def callproc(self, procname: str, *args, **kwargs) -> Any: ...
          #def nextset(self) -> bool: ...
          def close(self) -> None: ...
          def execute(self, operation: str, *args, **kwargs) -> Any: ...
          def executemany(self, operation: str, seq_of_parameters: Sequence[Any]) -> Any: ...
          def fetchone(self) -> Optional[Sequence[Any]]: ...
          def fetchmany(self, size: int = 0) -> Sequence[Sequence[Any]]: ...
          def fetchall(self) -> Sequence[Sequence[Any]]: ...
          def setinputsizes(self, sizes: Sequence[Any]): ...
          def setoutputsize(self, size: int, column: int): ...

  ### Ancestors

  - typing.Protocol
  - typing.Generic

  ### Instance variables

  `var arraysize : int`
    Expand source code

        @property
        def arraysize(self) -> int: ...

  `var description : str`
    Expand source code

        @property
        def description(self) -> str: ...

  `var rowcount : int`
    Expand source code

        @property
        def rowcount(self) -> int: ...

  ### Methods

  `def close(self) ‑> None`
    Expand source code

        def close(self) -> None: ...

  `def execute(self, operation: str, *args, **kwargs) ‑> Any`
    Expand source code

        def execute(self, operation: str, *args, **kwargs) -> Any: ...

  `def executemany(self, operation: str, seq_of_parameters: collections.abc.Sequence[typing.Any]) ‑> Any`
    Expand source code

        def executemany(self, operation: str, seq_of_parameters: Sequence[Any]) -> Any: ...

  `def fetchall(self) ‑> collections.abc.Sequence[collections.abc.Sequence[typing.Any]]`
    Expand source code

        def fetchall(self) -> Sequence[Sequence[Any]]: ...

  `def fetchmany(self, size: int = 0) ‑> collections.abc.Sequence[collections.abc.Sequence[typing.Any]]`
    Expand source code

        def fetchmany(self, size: int = 0) -> Sequence[Sequence[Any]]: ...

  `def fetchone(self) ‑> Optional[collections.abc.Sequence[typing.Any]]`
    Expand source code

        def fetchone(self) -> Optional[Sequence[Any]]: ...

  `def setinputsizes(self, sizes: collections.abc.Sequence[typing.Any])`
    Expand source code

        def setinputsizes(self, sizes: Sequence[Any]): ...

  `def setoutputsize(self, size: int, column: int)`
    Expand source code

        def setoutputsize(self, size: int, column: int): ...