Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Michael Bayer
Torsten Irländer torsten.irlaen...@googlemail.com wrote: Am Donnerstag, 12. Februar 2015 18:57:43 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com wrote: Hi, I have a similar prolem as described in

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Michael Bayer
Torsten Irländer torsten.irlaen...@googlemail.com wrote: Hi, I have a similar prolem as described in https://groups.google.com/forum/#!topic/sqlalchemy/OLeCERDZxyk I am using the secondary attribute to define the many-to-many relationship between User and Groups. Now i want

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread erik
Op donderdag 12 februari 2015 16:47:10 UTC+1 schreef Michael Bayer: er...@precompiled.com javascript: wrote: Hi Michael, It's a MSSQL (2012) backend. We have tried pyodbc and pymssql, using pyodbc or pymssql gives the same results. Pyodbc uses an sp_prepexec procedure,

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Am Donnerstag, 12. Februar 2015 18:57:43 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com javascript: wrote: Hi, I have a similar prolem as described in https://groups.google.com/forum/#!topic/sqlalchemy/OLeCERDZxyk I am using the secondary

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Am Donnerstag, 12. Februar 2015 21:02:21 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com javascript: wrote: Am Donnerstag, 12. Februar 2015 18:57:43 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com wrote: Hi,

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Am Donnerstag, 12. Februar 2015 22:16:37 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com javascript: wrote: Nothing is wrong with the IntegrityException if this Exception is actually raised :) That is currently my problem: I except such an exception but it

[sqlalchemy] Is there a tool/library that visually renders SQLAlchemy classes as UMLs or something similar?

2015-02-12 Thread Bao Niu
Is there a tool/library that visually presents all many-to-many relationships defined in a module using SQLAlchemy? I used to use an online database designer that automatically converts the diagram to SQLs, which is magical. Is there a similar tool that works with SQLAlchemy classes? Preferably

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Michael Bayer
Torsten Irländer torsten.irlaen...@googlemail.com wrote: First, thanks for your fast replies Michael! Do I understand it correctly that in contrast to plain SQL (Invoking the delete command in e.g psql), there is no way to make the database side constraints in the association table

Re: [sqlalchemy] Seamlessly combining data from multiple tables into a single SQLalchemy object

2015-02-12 Thread Dun Peal
Thanks, Jonathan and Simon. With its seamless query support, association_proxy looks perfect for my needs: it's just like having the extra fields on the master table, which is where I'd put them ideally if not for some pathological technical issues. I'm going to use it. Thanks, D. On

[sqlalchemy] Re: Is there a tool/library that visually renders SQLAlchemy classes as UMLs or something similar?

2015-02-12 Thread Jonathan Vanasco
If there is a graphical sql designer you prefer -- just use that to create your sql/database. Once you create the SQL, you can use `sqlalcodegen` to convert it to sqlalchemy models. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Michael Bayer
Torsten Irländer torsten.irlaen...@googlemail.com wrote: Nothing is wrong with the IntegrityException if this Exception is actually raised :) That is currently my problem: I except such an exception but it isn't raised. Instead the group is deleted (including all entries for this group

[sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread erik
Hi all, We are struggling with bad performance in a flask/sqlalchemy app on some databases, but not on others. Structurally, the databases are the same, however, we have noticed that the collation is different. The database that performs well uses Latin1_General_CI_AI, the bad performing one

[sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Hi, I have a similar prolem as described in https://groups.google.com/forum/#!topic/sqlalchemy/OLeCERDZxyk I am using the secondary attribute to define the many-to-many relationship between User and Groups. Now i want prevent to delete a group if a user is still in the group. Setting the

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread erik
Hi Michael, It's a MSSQL (2012) backend. We have tried pyodbc and pymssql, using pyodbc or pymssql gives the same results. Pyodbc uses an *sp_prepexec *procedure, which improves performance in some cases, and pymssql doesn't, but in either case the parameters passed to the functions are

[sqlalchemy] How do I chain joins?

2015-02-12 Thread Rafał Stożek
I'm trying to construct some queries with sqlalchemy core. I just started using sqlalchemy. It seemed like a good idea to use chaining to construct the query but from what I see select_from() chaining doesn't behave like I expected it to: http://pastebin.com/KcwedvLE Why the extra ,

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread Michael Bayer
e...@precompiled.com wrote: Hi all, We are struggling with bad performance in a flask/sqlalchemy app on some databases, but not on others. Structurally, the databases are the same, however, we have noticed that the collation is different. The database that performs well uses

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread Michael Bayer
e...@precompiled.com wrote: Hi Michael, It's a MSSQL (2012) backend. We have tried pyodbc and pymssql, using pyodbc or pymssql gives the same results. Pyodbc uses an sp_prepexec procedure, which improves performance in some cases, and pymssql doesn't, but in either case the