Skip to content

Feature request: MySQL support #36

@wesleykendall

Description

@wesleykendall

@tomage leaving a placeholder here for MySQL support since it is actively under development.

So far it looks like MySQL support is going to be close to feature compliance with Postgres, with the following primary notes:

  1. Conditions aren't part of the trigger definition. Conditional logic on the old/new rows have to be placed inside the trigger function itself, making it a bit more difficult to make the pgtrigger.Q and pgtrigger.F objects work as well. It should still be possible to make them completely compatible, but the first release of MySQL support may simply not have built-in condition support
  2. In order to support pgtrigger.ignore, we may need to make pg-connection compatible with MySQL so that we can hook into SQL generation and set temporary variables. Supporting pgtrigger.ignore will almost certainly not be available in the first release of MySQL support
  3. I have not researched much into statement-level triggers for MySQL. It is unclear what type of support will be available for this.
  4. MySQL does not support commenting directly on trigger objects, which is how pg-trigger maintains the hashes of installed triggers. We may need to insert a comment into the MySQL trigger definition to maintain its hash to know when the entire definition changes. Or we may need to rework how to detect trigger changes altogether. This is perhaps the most in-the-weeds change we have for MySQL support

It is likely that the support for MySQL and Postgres will be minimal enough that we can keep it in the same library. I am actively planning on renaming this to django-dbtrigger when we have close to full MySQL support.

Please thumbs up this feature request if you want it. It helps me prioritize my time when contributing to open source projects.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions