[sqlalchemy] Re: Mysql issue with big composite primary keys

2014-11-10 Thread Lele Gaifax
Iain Duncan iainduncanli...@gmail.com writes: Hi folks, I've been googling and cargo culting to no avail here, hope someone can help. I'm trying to get an app running on MySQL on OS X, that was running fine on MySQL on Linux. The issue is I have some large composite primarky keys: class

[sqlalchemy] Re: [Sqlachemy Core] Help on joining 3 tables

2014-11-10 Thread Tiago GuimarĂ£es
Hello! After some research on the *FromClause *object, I have figured out what should I do. So, my I got my code to work as follows: # Considering the table objects: A, B and C... # I first made a join clase over the A table. *J1 = A.join(A.c.some_col == B.c.some_col)* # The second join is

[sqlalchemy] Migrating databases: Alembic vs. Liquibase, Flyway, ??

2014-11-10 Thread Don Dwiggins
I'm gradually working toward getting serious about controlled DB migration (version control for DBs), and have been following the Alembic announcements with interest. (We're already using SA successfully in a Twisted environment, just making sure that all DB access is encapsulated in

[sqlalchemy] a problem recently encountered with the example 'Explain'

2014-11-10 Thread Jon Nelson
Using this https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/Explain if I take a select statement, and then produce an insert statement using i = some_table.insert(inline=True).from_select( some_select ) and then: e = Explain(i) I can't execute(e) because the statement is rendered

Re: [sqlalchemy] a problem recently encountered with the example 'Explain'

2014-11-10 Thread Michael Bayer
i made this change: text += compiler.process(element.statement, **kw) can you try that? thanks On Nov 10, 2014, at 4:32 PM, Jon Nelson jnel...@jamponi.net wrote: Using this https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/Explain if I take a select statement, and then

Re: [sqlalchemy] a problem recently encountered with the example 'Explain'

2014-11-10 Thread Michael Bayer
OK nevermind, do this: class explain(Executable, ClauseElement): def __init__(self, stmt, analyze=False): self.statement = _literal_as_text(stmt) self.analyze = analyze # helps with INSERT statements self.inline = getattr(stmt, 'inline',

Re: [sqlalchemy] a problem recently encountered with the example 'Explain'

2014-11-10 Thread Jon Nelson
Now the statement doesn't render with RETURNING, however I still get this: AttributeError: 'Explain' object has no attribute '_returning' -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from

[sqlalchemy] Re: Mysql issue with big composite primary keys

2014-11-10 Thread Jonathan Vanasco
This is a well known mysql-ism I remember reading that a short-term fix to this... is to change VARCHAR(256) to VARCHAR(255) It's fixed in some versions of the db (https://answers.launchpad.net/maria/+question/241612) It looks like 5.6.3 is the earliest :