grai_source_mssql
loader

BaseSettings Objects

class BaseSettings(pydantic.BaseSettings)

Config Objects

class Config()

Protocol Objects

class Protocol(Enum)

MsSqlSettings Objects

class MsSqlSettings(BaseSettings)

validate_protocol

@validator("protocol")
def validate_protocol(cls, value)

Arguments:

value:

Returns:

connection_string

def connection_string()

validate_driver

@validator("driver")
def validate_driver(cls, value)

Arguments:

value:

Returns:

parse_empty_values

@root_validator(pre=True)
def parse_empty_values(cls, values)

Empty strings should be treated as missing

Arguments:

values:

Returns:

MsSqlGraiSettings Objects

class MsSqlGraiSettings(BaseSettings)

ConnectorSettings Objects

class ConnectorSettings(MsSqlSettings, MsSqlGraiSettings)

MsSQLConnector Objects

class MsSQLConnector()

connect

def connect() -> pyodbc.connect

Arguments:

Returns:

connection

@property
def connection()

close

def close() -> None

Arguments:

Returns:

query_runner

def query_runner(query: str, params: List = []) -> List[Dict]

Arguments:

query (str):

  • params List, optional - (Default value = [])

Returns:

tables

@cached_property
def tables() -> List[Table]

Create and return a list of dictionaries with the schemas and names of tables in the database connected to by the connection argument.

Arguments:

Returns:

columns

@cached_property
def columns() -> List[Column]

Creates and returns a list of dictionaries for the specified schema.table in the database connected to.

Arguments:

Returns:

column_map

@cached_property
def column_map() -> Dict[Tuple[str, str], List[Column]]

Arguments:

Returns:

get_table_columns

def get_table_columns(table: Table) -> List[Column]

Arguments:

table (Table):

Returns:

foreign_keys

@cached_property
def foreign_keys() -> List[Edge]

This needs to be tested / evaluated

Arguments:

Returns:

get_nodes

def get_nodes() -> List[MsSqlNode]

Arguments:

Returns:

get_edges

def get_edges() -> List[Edge]

Arguments:

Returns:

get_nodes_and_edges

def get_nodes_and_edges() -> Tuple[List[MsSqlNode], List[Edge]]

Arguments:

Returns: