# mayim.base.interface

# Table of Contents

# BaseInterface

class BaseInterface(ABC)

[view_source] (opens new window)

# __init__

def __init__(dsn: Optional[str] = None,
             host: Optional[int] = None,
             port: Optional[int] = None,
             user: Optional[str] = None,
             password: Optional[str] = None,
             db: Optional[int] = None,
             query: Optional[str] = None) -> None

[view_source] (opens new window)

DB class initialization.

Arguments:

  • dsn str, optional - DB data source name
  • host str, optional - DB address URL or IP
  • port int, optional - DB port. Defaults to 6379
  • password str, optional - DB password
  • db int, optional - DB db. Defaults to 1
  • query str, optional - DB query parameters. Defaults to None

# close

@abstractmethod
async def close()

[view_source] (opens new window)

# connection

@abstractmethod
def connection(timeout: Optional[float] = None)

[view_source] (opens new window)

# db

@property
def db()

[view_source] (opens new window)

# do_commit

def do_commit() -> bool

[view_source] (opens new window)

# dsn

@property
def dsn()

[view_source] (opens new window)

# existing_connection

def existing_connection()

[view_source] (opens new window)

# full_dsn

@property
def full_dsn()

[view_source] (opens new window)

# host

@property
def host()

[view_source] (opens new window)

# in_transaction

def in_transaction() -> bool

[view_source] (opens new window)

# open

@abstractmethod
async def open()

[view_source] (opens new window)

# password

@property
def password()

[view_source] (opens new window)

# port

@property
def port()

[view_source] (opens new window)

# registered_interfaces: Set[Type[BaseInterface]]

Default: set()

# scheme

Default: "dummy"

# user

@property
def user()

[view_source] (opens new window)

# UrlMapping