> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dialects and source setup

A dialect is named as the first argument of
[`replica()`](https://docs.bijection.com/integrations/replica), paired with its receiver in the mount call as `provider`:

| Dialect | Argument | Receiver | Reads | Position |
| - | - | - | - | - |
| `postgres` | `"postgres"` | `postgresLogical` | Logical replication (`pgoutput`) through a slot | LSN |
| `mysql` | `"mysql"` | `mysqlBinlog` | The row-based binary log | GTID set |
| `mariadb` | `"mariadb"` | `mysqlBinlog` | The row-based binary log | GTID list |
| `sqlserver` | `"sqlserver"` | `sqlServerCdc` | SQL Server CDC change functions | LSN |
| `oracle` | `"oracle"` | `oracleLogMiner` | [Oracle Net LogMiner](https://docs.bijection.com/integrations/native-oracle.md#archived-redo-with-logminer) | Commit SCN |
| `db2` | `"db2"` | — | Unavailable on installations | — |
| `envelope` | `"envelope"` | `debeziumTopicReceiver` | Debezium change envelopes on your Kafka topics | Partition offsets |

Every dialect needs a self-describing log: each change carries enough to decode
its row without a schema history. Bijection keeps no schema history and parses
no DDL. A change that breaks a table's declared columns or key
[stops that table](https://docs.bijection.com/integrations/replica/groups.md).

Run `bijection mutate <path>.inspect` after deploying to submit a read-only
probe against the source; `<path>.status` then reports every problem found
along with the setup SQL that fixes it. Bijection never runs that SQL and never creates helper schemas,
tables, triggers or heartbeat rows in the source. A replica whose probe has not
passed stays `stopped`, with the setup SQL in its status.

## PostgreSQL

PostgreSQL 16 through 18, on a primary or a hot standby. Probing requires
`wal_level = logical` (a restart) and, on a standby, `hot_standby_feedback = on`
and a `primary_slot_name`:

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ALTER SYSTEM SET wal_level = logical;
```

For a replica whose login is `bijection_replica`, `inspect` prints the
publication and privilege statements needed:

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
CREATE PUBLICATION "bijection_warehouse" FOR TABLE "public"."lines" ("id", "order_id"), "public"."orders" ("description", "id", "payload", "total") WITH (publish = 'insert, update, delete, truncate');
-- "public"."lines": keep REPLICA IDENTITY DEFAULT when its key is the primary key; for a declared unique index run ALTER TABLE "public"."lines" REPLICA IDENTITY USING INDEX <that index>;
-- "public"."orders": keep REPLICA IDENTITY DEFAULT when its key is the primary key; for a declared unique index run ALTER TABLE "public"."orders" REPLICA IDENTITY USING INDEX <that index>;
ALTER ROLE "bijection_replica" WITH REPLICATION;
GRANT USAGE ON SCHEMA "public" TO "bijection_replica";
GRANT SELECT ON TABLE "public"."lines" TO "bijection_replica";
GRANT SELECT ON TABLE "public"."orders" TO "bijection_replica";
GRANT EXECUTE ON FUNCTION pg_catalog.pg_logical_emit_message(boolean, text, text) TO "bijection_replica";
```

The publication must list the replicated tables with their declared columns, no
row filter, and every row mutation. The replication slot is the replica's
[hold](https://docs.bijection.com/integrations/replica/lag-and-hold.md). Set `max_slot_wal_keep_size` to a
finite size above the replica's hold so the server, too, bounds what the slot
can retain.

## MySQL

MySQL 8.0 or later with the binary log on (`--log-bin`) and GTIDs. For the
account `'bijection'@'%'`:

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'bijection'@'%';
GRANT SELECT ON `inventory`.`products` TO 'bijection'@'%';
GRANT SELECT ON `inventory`.`stock` TO 'bijection'@'%';
SET PERSIST binlog_format = 'ROW';
SET PERSIST binlog_row_image = 'FULL';
SET PERSIST binlog_row_metadata = 'FULL';
-- gtid_mode must be ON (enforce_gtid_consistency = ON, then gtid_mode one step at a time)
ALTER TABLE `inventory`.`products` ENGINE = InnoDB;
ALTER TABLE `inventory`.`stock` ENGINE = InnoDB;
```

When `gtid_mode` is not `ON`, `inspect` prints the remaining steps from the
server's current mode:

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
SET PERSIST enforce_gtid_consistency = ON;
SET PERSIST gtid_mode = OFF_PERMISSIVE;
SET PERSIST gtid_mode = ON_PERMISSIVE;
SET PERSIST gtid_mode = ON;
```

Only transactional InnoDB tables are replicated. The server's own binary log
retention (`binlog_expire_logs_seconds`) keeps the log for every replica: keep
it longer than the replica may fall behind. A replica whose position the server
has purged is `lost` and re-baselines.

## MariaDB

MariaDB 10.5 or later with the binary log on:

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
GRANT REPLICATION SLAVE, BINLOG MONITOR ON *.* TO 'bijection'@'%';
GRANT SELECT ON `inventory`.`products` TO 'bijection'@'%';
GRANT SELECT ON `inventory`.`stock` TO 'bijection'@'%';
SET GLOBAL binlog_format = 'ROW';
SET GLOBAL binlog_row_image = 'FULL';
SET GLOBAL binlog_row_metadata = 'FULL';
-- SET GLOBAL lasts until a restart: also set binlog_format=ROW, binlog_row_image=FULL and binlog_row_metadata=FULL in the server's option file
ALTER TABLE `inventory`.`products` ENGINE = InnoDB;
ALTER TABLE `inventory`.`stock` ENGINE = InnoDB;
```

Positions are MariaDB GTIDs, so a failover to a replica holding the same GTIDs
continues without a new baseline. Binary log retention works as for MySQL.

## SQL Server

SQL Server with change data capture and SQL Server Agent running, Azure SQL
Managed Instance, or Azure SQL Database (which schedules CDC itself):

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
USE [shop];
-- Needs sysadmin. SQL Server Agent must run (Azure SQL Database schedules CDC itself).
EXEC sys.sp_cdc_enable_db;
CREATE ROLE [bijection_replica];
EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'lines', @capture_instance = N'dbo_lines', @role_name = N'bijection_replica', @captured_column_list = N'[id], [order_id]', @supports_net_changes = 0, @allow_partition_switch = 0;
GRANT SELECT ON [dbo].[lines] TO [bijection_replica];
EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'orders', @capture_instance = N'dbo_orders', @role_name = N'bijection_replica', @captured_column_list = N'[id], [total]', @supports_net_changes = 0, @allow_partition_switch = 0;
GRANT SELECT ON [dbo].[orders] TO [bijection_replica];
GRANT SELECT ON SCHEMA::[cdc] TO [bijection_replica];
GRANT VIEW DEFINITION TO [bijection_replica];
-- Add the replica login's database user: ALTER ROLE [bijection_replica] ADD MEMBER [<user>]; and, in master, GRANT VIEW SERVER STATE TO [<login>]; for the SQL Server Agent check.
```

Each table needs a capture instance that captures every declared column and
does not allow partition switching. SQL Server's CDC cleanup job owns
retention:

```sql theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
EXEC sys.sp_cdc_change_job @job_type = N'cleanup', @retention = 4320;
```

A replica whose position cleanup removed is `lost`. Replacing a table's capture
instance stops that table until it is
[re-baselined](https://docs.bijection.com/integrations/replica/status.md).

## Oracle

Use `oracleLogMiner` from `@bijectionhq/app-sql` with
`replica("oracle", { tables })`, or see the
[Oracle Database relation source](https://docs.bijection.com/integrations/native-oracle.md) for Oracle Net
observations, archived-redo LogMiner and Oracle REST Data Services.

## Db2

Db2 has no mounted native SQL mode. Observations require a DRDA requester that
runs on the installation's permit-fenced TLS socket.

[IBM Db2 SQL Replication Capture](https://www.ibm.com/docs/en/idr/11.4.0?topic=sr-capture-data-from-db2-sources-in-sql-replication)

## Envelope

The `envelope` dialect reads Debezium change envelopes from your Kafka topics
through a stream receiver (`debeziumTopicReceiver` from
`@bijectionhq/app-streams`). Bijection runs no Kafka Connect, connector or
offset store, and commits no consumer group; it keeps the partition offsets as
its feed cursor. Configure the Debezium connector with:

```properties connector.properties theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
value.converter=org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable=true
provide.transaction.metadata=true
snapshot.mode=initial
```

Name each table's change topic as its `source`. Baselines are the connector's
own snapshot records (`op: r`) at the start of each change topic, so envelope
tables start `live`. Keep `cleanup.policy=delete` with no compaction and
retention for as long as the replica may be paused. Topic retention is yours: a
replica whose offset falls behind a partition's log start stops as `lost`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.