Re: [sqlalchemy] why MySQL DOUBLE is asdecimal=True by default

2019-04-29 Thread Mike Bayer
still looks like DOUBLE should be dealing with Python floats. DOUBLE_PRECISION in the Oracle dialect is also Float and doesn't default to decimal coercion. We can fix this problem, it's just one of those changes that you have to warn users like crazy on and then just do the change on a major relea

[sqlalchemy] Re: Order By Relationship Set Order Type Desc

2019-04-29 Thread mkwyche
Looks like you can add `.desc()` after the column name :-D On Monday, April 29, 2019 at 3:40:24 PM UTC-4, mkwyche wrote: > > Looking through the docs and I see there's an `order_by` attribute on > relationships( > https://docs.sqlalchemy.org/en/13/orm/relationship_api.html#sqlalchemy.orm.relatio

[sqlalchemy] Order By Relationship Set Order Type Desc

2019-04-29 Thread mkwyche
Looking through the docs and I see there's an `order_by` attribute on relationships( https://docs.sqlalchemy.org/en/13/orm/relationship_api.html#sqlalchemy.orm.relationship). How would I order by desc instead of asc? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://

Re: [sqlalchemy] why MySQL DOUBLE is asdecimal=True by default

2019-04-29 Thread Jonathan Vanasco
FWIW, that PR would have been during MySQL5.0 - not 5.5. 5.0 was released in October 2005; 5.1 was not released until November 2008 assuming the 5.0 docs... > > https://docs.oracle.com/cd/E19078-01/mysql/mysql-refman-5.0/data-types.html#numeric-types looking deeper at their docs, this bit may

Re: [sqlalchemy] why MySQL DOUBLE is asdecimal=True by default

2019-04-29 Thread Michał Dobrzański
Interesting. Thank you for the extensive explanation. pon., 29 kwi 2019 o 19:49 Mike Bayer napisał(a): > On Mon, Apr 29, 2019 at 1:13 PM mdob wrote: > > > > Just out of curiosity, why it was decided that MySQL DOUBLE, which is > approximation, will be presented in ORM as Decimal by default inst

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Lyla Fischer
Awesome! Thanks! -Lyla On Mon, Apr 29, 2019 at 1:55 PM Mike Bayer wrote: > On Mon, Apr 29, 2019 at 1:37 PM Lyla Fischer wrote: > > > > Ah. I think that I have been thinking of a session as a cache instead of > a transaction, which is incorrect. (It's similar because you have to worry > about p

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Mike Bayer
On Mon, Apr 29, 2019 at 1:37 PM Lyla Fischer wrote: > > Ah. I think that I have been thinking of a session as a cache instead of a > transaction, which is incorrect. (It's similar because you have to worry > about persistence in the face of failures, but not-similar, because you're > not worrie

Re: [sqlalchemy] why MySQL DOUBLE is asdecimal=True by default

2019-04-29 Thread Mike Bayer
On Mon, Apr 29, 2019 at 1:13 PM mdob wrote: > > Just out of curiosity, why it was decided that MySQL DOUBLE, which is > approximation, will be presented in ORM as Decimal by default instead of > float? > > MySQL DOUBLE - > https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html > SQLA

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Lyla Fischer
Ah. I think that I have been thinking of a session as a cache instead of a transaction, which is incorrect. (It's similar because you have to worry about persistence in the face of failures, but not-similar, because you're not worried about communication with other processes. That is, a commit is n

[sqlalchemy] why MySQL DOUBLE is asdecimal=True by default

2019-04-29 Thread mdob
Just out of curiosity, why it was decided that MySQL DOUBLE, which is approximation, will be presented in ORM as Decimal by default instead of float? MySQL DOUBLE - https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html SQLAlchemy DOUBLE - https://docs.sqlalchemy.org/en/13/dialects/

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Mike Bayer
On Mon, Apr 29, 2019 at 12:04 PM Lyla Fischer wrote: > > Sorry about the language. I'll try to stick to "intuitive" and "surprising" > in the future. > > I guess that I am familiar enough with the concept that something needs to > persist in the database before it can be referenced in the databa

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Lyla Fischer
Sorry about the language. I'll try to stick to "intuitive" and "surprising" in the future. I guess that I am familiar enough with the concept that something needs to persist in the database before it can be referenced in the database that I was surprised when an object was already in the database

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Mike Bayer
On Mon, Apr 29, 2019 at 7:22 AM Lyla Fischer wrote: > > If I can comment on what seems instinctive to someone who just recently read > the documentation, and made assumptions based off of it: My understanding was > that the relationship abstractions were supposed to be about making foreign > ke

Re: [sqlalchemy] Possible regression?

2019-04-29 Thread Lyla Fischer
If I can comment on what seems instinctive to someone who just recently read the documentation, and made assumptions based off of it: My understanding was that the relationship abstractions were supposed to be about making foreign keys easier to keep track of, and being able to go both ways on a re