SQL Connection Model

Smarter API SQL Connection Manifest Constants

Smarter API Manifest - SqlConnection.spec

class smarter.apps.connection.manifest.models.sql_connection.spec.Connection(*, dbEngine: str, hostname: str, port: int | None = None, database: str, username: str | None = None, password: str | None = None, timeout: int = 30, useSsl: bool = False, sslCert: str | None = None, sslKey: str | None = None, sslCa: str | None = None, proxyHost: str | None = None, proxyPort: int | None = None, proxyUsername: str | None = None, proxyPassword: str | None = None, sshKnownHosts: str | None = None, poolSize: int = 5, maxOverflow: int = 10, authenticationMethod: str = 'none')[source]

Bases: SmarterBasePydanticModel

Smarter API - generic SQL Connection class.

authenticationMethod: str
database: str
dbEngine: str
hostname: str
maxOverflow: int
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

password: str | None
poolSize: int
port: int | None
proxyHost: str | None
proxyPassword: str | None
proxyPort: int | None
proxyUsername: str | None
sshKnownHosts: str | None
sslCa: str | None
sslCert: str | None
sslKey: str | None
timeout: int
useSsl: bool
username: str | None
classmethod validate_authentication_method(v)[source]
Return type:

str

classmethod validate_database(v)[source]
Return type:

str

classmethod validate_db_engine(v)[source]
Return type:

str

classmethod validate_host(v)[source]
Return type:

str

classmethod validate_max_overflow(v)[source]
Return type:

int

classmethod validate_password(v)[source]
Return type:

str

classmethod validate_pool_size(v)[source]
Return type:

int

classmethod validate_port(v, values)[source]
Return type:

int

classmethod validate_proxy_host(v)[source]
Return type:

str

classmethod validate_proxy_port(v)[source]
Return type:

int

classmethod validate_ssh_known_hosts(v)[source]
Return type:

Optional[str]

classmethod validate_ssl_fields(v)[source]
Return type:

Optional[str]

classmethod validate_timeout(v)[source]
Return type:

int

classmethod validate_use_ssl(v)[source]
Return type:

bool

classmethod validate_username(v)[source]
Return type:

str

class smarter.apps.connection.manifest.models.sql_connection.spec.SAMSqlConnectionSpec(*, connection: Connection)[source]

Bases: AbstractSAMSpecBase

Smarter API Sql Connection Manifest Connection.spec

class_identifier: ClassVar[str] = 'SqlConnection.spec'
connection: Connection
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

Smarter API SqlConnection Manifest

class smarter.apps.connection.manifest.models.sql_connection.model.SAMSqlConnection(*, apiVersion: str, kind: str, metadata: SAMConnectionCommonMetadata, spec: SAMSqlConnectionSpec, status: SAMConnectionCommonStatus | None = None)[source]

Bases: AbstractSAMBase

Smarter API Manifest - SqlConnection Model

class_identifier: ClassVar[str] = 'SqlConnection'
metadata: SAMConnectionCommonMetadata
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

spec: SAMSqlConnectionSpec
status: SAMConnectionCommonStatus | None