Connectors / Databases

Microsoft SQL Server

sink

Microsoft SQL Server sink

Install

cargo install faucet-cli --features sink-mssql
faucet init --sink mssql
# Cargo.toml — use it as a library
cargo add faucet-sink-mssql

Starter config

sink:
  type: mssql
  config:
    # connection_url: ""    # `mssql://user:pass@host:1433/database` URL form.
    # connection_string: ""    # ADO.NET-style connection string handed straight to `tiberius`, e.g.
    # tls: { ... }    # TLS configuration for an MSSQL connection.
    table: ""    # REQUIRED — Target table, optionally schema-qualified (e.g.
    # column_mapping: { type: auto_columns }    # one of: auto_columns, json_column
      # --- Alternative variants — replace the block above with one of these ---
      # type: json_column
      # column: ""    # REQUIRED
    # batch_size: 500    # Rows per multi-row `INSERT`.
    # max_connections: 5    # Maximum pooled connections.
    # transaction_per_batch: true    # Wrap each batch's INSERTs in `BEGIN TRAN` / `COMMIT TRAN`.
    # isolate_row_failures: true    # On a batch failure, retry row-by-row to isolate the offender so good rows still land and only the bad row is DLQ-routed.
    # statement_timeout_secs: 300    # Per-statement timeout in seconds (`0` disables).
    # create_table: true    # Create the target table if it does not exist (#580).
    # write_mode: null    # Write semantics for a sink.
    # key: []    # Key columns.
    # delete_marker: null    # Optional.
    # rollback: null    # Runtime rollback settings (#706): the run id to journal under, the run-id column, and whether to journal before-images / keep a replaced table.
    # staging: null    # Staged bulk load (#528): stage each page to Azure Blob / ADLS and have SQL Server / Synapse pull it with `COPY INTO` instead of parameterized `INSERT`s.

Capabilities

Delivery Exactly-once (atomic watermark)
Write modes append, upsert, delete, overwrite
Exactly-once writes Yes
Schema evolution Yes
Scoped cleanup Yes
Staged bulk load Yes
Run rollback No
Compression No

Config fields

FieldTypeDefaultDescription
table
required
string — Target table, optionally schema-qualified (e.g. dbo.events).
connection_url string — mssql://user:pass@host:1433/database URL form. Mutually exclusive with connection_string.
connection_string string — ADO.NET-style connection string handed straight to tiberius, e.g. Server=tcp:host,1433;Database=db;User Id=sa;Password=...;. Mutually exclusive with connection_url.
tls object type: prefer TLS / encryption settings. Defaults to MssqlTlsMode::Prefer.
column_mapping object type: json_columncolumn: data How records map onto columns. Defaults to a single data JSON column.
batch_size integer 500 Rows per multi-row INSERT. Auto-split further so rows * columns stays within MSSQL's 2100-parameter limit. 0 sends the whole page (still param-split). Defaults to 500.
max_connections integer 5 Maximum pooled connections. Defaults to 5.
transaction_per_batch boolean true Wrap each batch's INSERTs in BEGIN TRAN / COMMIT TRAN. Defaults to true.
isolate_row_failures boolean true On a batch failure, retry row-by-row to isolate the offender so good rows still land and only the bad row is DLQ-routed. When false, one bad row fails the whole batch (fewer round-trips). Defaults to true.
statement_timeout_secs integer 300 Per-statement timeout in seconds (0 disables). Defaults to 300.
create_table boolean true Create the target table if it does not exist (#580). Enabled by default: a first-ever sync cannot assume the destination already exists.
write_mode object append Append (default), upsert, or delete.
key array [] Key columns. Required and non-empty for upsert/delete; ignored for append.
delete_marker object — Optional. Upsert only: rows whose field matches one of values are deletes; all others are upserts. The marker field is stripped from upsert rows before writing.
rollback object — Runtime rollback settings (#706): the run id to journal under, the run-id column, and whether to journal before-images / keep a replaced table. Injected per invocation by the CLI when a config has a top-level rollback: block — not meant to be written by hand.
staging object — Staged bulk load (#528): stage each page to Azure Blob / ADLS and have SQL Server / Synapse pull it with COPY INTO instead of parameterized INSERTs. Absent ⇒ the ordinary insert path. Requires the crate's staging feature at build time to execute. A staged page loads whole, also under a DLQ, and the sink then declares no exactly-once writes.
Get started

Your first pipeline runs in five minutes.

Install the CLI, scaffold a config, and move real data — nothing external to stand up.

curl -LsSf https://github.com/faucet-hq/faucet-stream/releases/latest/download/faucet-cli-installer.sh | sh
brew install faucet-hq/faucet-stream/faucet-cli