Merge Drizzle dialect

Issue #2003 resolved
Former user created an issue

Hi!

We're using this in several internal drizzle projects and would love to get it merged. Here's an hg repo with the patch all merged up with latest trunk:

hg clone http://bitbucket.org/mordred/sqlalchemy

Also going to attach it in patch version.

Comments (15)

  1. Mike Bayer repo owner
    • changed component to mysql

    pretty good. I think we can replace self.get_keyword_prefix() with self.name / self.dialect.name, can you give that a test and attach ?. Also add a line to doc/build/core/engines.rst, doc/build/dialects/index.rst, add doc/build/dialects/drizzle.rst.

  2. Mike Bayer repo owner

    OK, couple more questions - do you mean to say extract_map = mysql_dialect.MySQLCompiler.extract_map.copy at the top of DrizzleCompiler ? also, why reimplementing all of the types + DrizzleTypeCompiler, the types/MySQLTypeCompiler object in MySQL is not usable as a base here? Just a little concerned that all that duplication means any fixes on the MySQL side have to be copied over. Also are you working on 0.6 or can this just be for 0.7 ? betas of 0.7 should be released in january.

  3. Former user Account Deleted

    MySQLTypeCompiler isn't usable as a base (or not useful as a base) because it injects UNSIGNED and/or ZEROFILL on all the numerics - so we'd have to override way more code than just starting direct from the base. (We support a much more limited set of types than MySQL)

    This can TOTALLY be just for 0.7. The places that we're currently using sqlalchemy/drizzle support we're running from tip of hg tree. :)

    As for DrizzleCompiler - probably. Actually, it looks like we maybe don't even need it there? Do you want me to make that change and re-submit a new patch?

  4. Mike Bayer repo owner

    Hi Monty -

    can you try the attached patch against the current tip, 86e6c2bafb03e9620f6289c709d0076e6291f624 ?

    This patch moves everything "mysqldb" related into a new connector module where its functionality can be shared by MySQL and Drizzle. It also removes just about everything that was redundant in Drizzle vs. MySQL. This is very important as I need to be able to improve and migrate the architecture of MySQL and MySQLdb without redudant work.

    If the patch works we can target this for 0.7.0 since it reorganizes the MySQL dialect itself.

  5. Former user Account Deleted

    Ok. It's doing really well with the unittests... AND I found a few new things to fix. Attaching a new patch...

  6. Former user Account Deleted

    While I'm at it, while running unittests, I'm getting a bunch of this:

    Error emptying table a_table: IntegrityError("(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (test.a_table, CONSTRAINT a_table_ibfk_1 FOREIGN KEY (parent_id) REFERENCES a_table (id))')",)

    Which I believe might actually be an underlying drizzle bug. Any idea where I could look to be able to replicate the queries that led to this so I can go attack our test suite?

  7. Former user Account Deleted

    Oh. Whoops - I didn't see the attached patch - my brain read "patch" as "tip of hg trunk"

    Attaching a patch which is based on your patch, but also has the changes I made after running unittests. Otherwise it's working great!

  8. Mike Bayer repo owner

    the warnings with the foreign key constraints occur with MySQL as well so that's probably something the test suite has to take into account.

  9. Log in to comment