Skip to content

Instantly share code, notes, and snippets.

@iarna
Created October 29, 2012 19:10
Show Gist options
  • Save iarna/3975812 to your computer and use it in GitHub Desktop.
Save iarna/3975812 to your computer and use it in GitHub Desktop.
Modyllic Dialect Handling and Conversion

ModyllicSQL is our platonic ideal SQL schema, and a moving target as we integrate more interesting features from various databases. It begins life as a full-metadata dialect of MySQL with a few minor extensions already documented.

Dialect specific parsers, eg, when loading directly from a database, generate a dialect specific schema.

Prior to dumping, if the schema is not yet dialect specific, it will be mutated to be so.

Prior to diffing, all of the schema must be mutated to the target dialect. If both are different database specific dialects, one dialect is chosen and the other converted into it, typically via conversion to ModyllicSQL and then on to the target dialect, although it should be possible to provide direct conversion, which is useful in the case of nearly identical dialects.

Migration is like diffing, where we always choose the database's dialect to convert to.

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