tabsdata.MSSQLSource#

class MSSQLSource(
connection_string: str,
query: str | list[str],
chunk_size: int = 50000,
credentials: dict | UserPasswordCredentials | None = None,
server: str | Secret = None,
database: str | Secret = None,
driver: str | Secret = None,
initial_values: dict | None = None,
**kwargs,
)#

Bases: SourcePlugin

Source plugin for Microsoft SQL Server.

__init__(
connection_string: str,
query: str | list[str],
chunk_size: int = 50000,
credentials: dict | UserPasswordCredentials | None = None,
server: str | Secret = None,
database: str | Secret = None,
driver: str | Secret = None,
initial_values: dict | None = None,
**kwargs,
)#

Initialize the MSSQLSource with a connection string and a query.

Parameters:
  • connection_string (str) – The connection string to connect to the database.

  • query (str | list[str]) – The SQL query or queries to execute.

  • chunk_size (int) – The number of rows to fetch in each chunk. Defaults to 50000.

Methods

__init__(connection_string, query[, ...])

Initialize the MSSQLSource with a connection string and a query.

chunk(working_dir)

Execute the query and yield chunks of data.

stream(working_dir)

Attributes

connection_string

Get the connection string for the database.

credentials

The credentials required to access Microsoft SQL Server.

initial_values

The initial values for the parameters in the SQL queries.

query

Get the SQL query or queries to execute.