tabsdata.MSSQLDestination#
- class MSSQLDestination(
- connection_string: str,
- destination_table: str | list[str],
- credentials: dict | UserPasswordCredentials | None = None,
- server: str | Secret = None,
- database: str | Secret = None,
- driver: str | Secret = None,
- if_table_exists: Literal['append', 'replace'] = 'append',
- chunk_size: int = 50000,
- **kwargs,
Bases:
DestinationPluginDestination plugin for Microsoft SQL Server.
- __init__(
- connection_string: str,
- destination_table: str | list[str],
- credentials: dict | UserPasswordCredentials | None = None,
- server: str | Secret = None,
- database: str | Secret = None,
- driver: str | Secret = None,
- if_table_exists: Literal['append', 'replace'] = 'append',
- chunk_size: int = 50000,
- **kwargs,
Initialize the MSSQLDestination with a connection string and a table name.
- Parameters:
connection_string (str) – The connection string to connect to the database.
destination_table (str | List[str]) – The table(s) to create. If multiple tables are provided, they must be provided as a list.
if_table_exists ({'append', 'replace'}) –
The strategy to follow when the table already exists. - ‘replace’ will create a new database table, overwriting an
existing one.
‘append’ will append to an existing table.
Methods
__init__(connection_string, destination_table)Initialize the MSSQLDestination with a connection string and a table name.
chunk(working_dir, *results)Trigger the exporting of the data to local parquet chunks. This method will
stream(working_dir, *results)Trigger the exporting of the data. This method will receive the resulting data
write(files)This method is used to write the files to the database.
Attributes
connection_stringGet the connection string for the database.
credentialsThe credentials required to access Microsoft SQL Server.
destination_tableGet the destination table(s) where the data will be stored.
if_table_existsReturns the value of the if_table_exists property.