Skip to content

materialize-mysql: implement 'Additional Table Create SQL'#4263

Open
jacobmarble wants to merge 1 commit intomainfrom
jgm-mysql
Open

materialize-mysql: implement 'Additional Table Create SQL'#4263
jacobmarble wants to merge 1 commit intomainfrom
jgm-mysql

Conversation

@jacobmarble
Copy link
Copy Markdown
Contributor

@jacobmarble jacobmarble commented Apr 17, 2026

Description:

Closes #4028

Implement the "Additional Table Create SQL" materialize-mysql feature.

The feature is slightly different to the materialize-postgres equivalent - MySQL cannot perform SQL statements after CREATE TABLE in one transaction, hence "Additional SQL statement(s) to be run after the table is created."

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

Docs updated at estuary/flow#2869

Notes for reviewers:

(anything that might help someone review this PR)

@@ -1,2 +1,2 @@
will:secret1234@tcp(example.com:3306)/somedb?clientFoundRows=true&connectionAttributes=program_name%3AEstuary+materialize-mysql
will:secret1234@tcp(example.com:3306)/somedb?clientFoundRows=true&connectionAttributes=program_name%3AEstuary+materialize-mysql&multiStatements=true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI multiStatements=true allows users to provide multiple statements to the additional SQL value. Postgres allows multiple statements by default, MySQL requires it to be explicitly enabled.

@jacobmarble jacobmarble requested a review from a team April 17, 2026 19:51
res = tc.Resource.(tableConfig)
}

if _, err := c.db.ExecContext(ctx, tc.TableCreateSql); err != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these statements be in a transaction so all tables are created atomically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "additional table creation sql" to the MySQL connector

2 participants