it's two bugs
https://bitbucket.org/zzzeek/sqlalchemy/issues/4011/joined-subclass-to-2-level-subquery-load
and reopened in master
https://bitbucket.org/zzzeek/sqlalchemy/issues/3963/aliased-vs-non-aliased-specificity-in
thanks!
On 06/15/2017 01:23 AM, Sherwin Yu wrote:
We found a bug
We found a bug involving filtering a JTI relation and subqueryloading. The
emitted SQL for the subqueryload does not correctly join the child and
parent JTI tables, resulting in a cross product.
Info:
- psql (PostgreSQL) 9.5.7
- SQLAlchemy 0.9.10
Suppose we have the following relations
Hi---
I set out about 20 minutes ago to learn SQLAlchemy, and the third hit
Google gave me was the Object Relational Tutorial:
http://docs.sqlalchemy.org/en/latest/orm/tutorial.html
Where I stalled on the second sentence of the second paragraph, the
intended meaning of which I cannot
Ah ha!
I figured this out. It was a mix of a lazy eye and some peculiarities
between Postgres(live) and sqlite(test-case).
Given the query:
session.query(Foo).options(contains_eager('bar')).order_by(Foo.id.desc()).offset(0).limit(100).all()]
The SQL is (approx)
select foo.*, bar.*
On Friday, October 30, 2015 at 11:38:50 AM UTC-4, Michael Bayer wrote:
> you wouldn't typically want to specify contains_eager('bar') if the SQL
> has no JOIN in it, which you'd do with query.join().
There's no valid reason for using the `contains_eager` here -- it's just a
typo.
I
On 10/29/15 7:54 PM, Jonathan Vanasco wrote:
>
>
> The difference is between these 2 forms:
>
> [(f.id, f.bar_id) for f in
> session.query(Foo).options(joinedload('bar')).order_by(Foo.id.desc()).offset(0).limit(100).all()]
> [(f.id, f.bar_id) for f in
>
I've spent an hour trying to reproduce this bug and can't. I'm hoping
someone can suggest what might be going on so I can make this reproducable
for a bug report
I have 2 classes:
class Foo(Base):
__tablename__ = 'foo'
id = Column(Integer, primary_key=True)
bar_id
On 10/29/15 6:50 PM, Jonathan Vanasco wrote:
> I've spent an hour trying to reproduce this bug and can't. I'm hoping
> someone can suggest what might be going on so I can make this
> reproducable for a bug report
>
> I have 2 classes:
>
> class Foo(Base):
> __tablename__ = 'foo'
On Thursday, October 29, 2015 at 7:33:47 PM UTC-4, Michael Bayer wrote:
>
> i dont have an immediate answer, though i wonder why you aren't using
> ~Bar.is_x.is(True) for that "IS NOT"...
>
Old habits and styleguide. The `~` ended up being missed on too many
glances and code-reviews.
>
Hello Mike,
On Tue, 05 May 2015 21:09:31 +0200, Mike Bayer mike...@zzzcomputing.com
wrote:
On 5/5/15 1:17 PM, Brecht Machiels wrote:
Oops, was a bit too quick there...
Here's the echo='debug' output:
2015-05-05 19:16:11,528 INFO sqlalchemy.engine.base.Engine SELECT *
FROM group_counts
Hi,
I updated sqlalchemy from 0.7.8 to 0.8.2 and one of my queries started
failing. I had a CTE expression with capital letters in it's name, and in
0.8 it wasn't getting consistently quoted, but it worked in 0.7.
I narrowed it down, and it only seems to happen in a query containing
multiple
On Apr 1, 2011, at 1:12 AM, Inside Zhou wrote:
Thank you for you answer,but I'm sorry,I don't quite follow you.
My confusion is that with the s.query(User).all(),SA issues SQL stmt the
same as user_table.select().execute(),but why the latter stmt can return
the row what I expected
First I try to create a table like this:
user_table = Table('user', metadata,
Column('id', Integer),
Column('name', Unicode)
)
then I discards the table in metadata and reload it by reflection with
overriding:
user_table = Table('user', metadata,
Column('id', Integer,
On Mar 31, 2011, at 9:31 PM, Inside Zhou wrote:
First I try to create a table like this:
user_table = Table('user', metadata,
Column('id', Integer),
Column('name', Unicode)
)
then I discards the table in metadata and reload it by reflection with
overriding:
user_table =
Thank you for you answer,but I'm sorry,I don't quite follow you.
My confusion is that with the s.query(User).all(),SA issues SQL stmt the
same as user_table.select().execute(),but why the latter stmt can return
the row what I expected whereas the former couldn't?
besides,the table in DB change
Hi
With sqlalchemy 0.7b1 and postgresql
if you define a BigInteger type for a primarykey, the SQL generated for
CREATE TABLE is a 'serial' and not a 'bigserial'.
(I am generating the sql using pylons)
I just started using sqlalchemy and not sure if this is a bug, but thought I
should notice you.
yes that is a bug, a regression from 0.6 where you'll get BIGSERIAL. ticket #
2065 is added thanks for the report !
On Feb 17, 2011, at 6:35 AM, Hayato ARAKI wrote:
Hi
With sqlalchemy 0.7b1 and postgresql
if you define a BigInteger type for a primarykey, the SQL generated for
CREATE
I'm not sure if this affects S.A 0.6.
It appears that orm.properties.RelationProperty. _post_init does not
create a _dependency_processor attribute if the relation is viewonly.
Line1016:
if not self.viewonly:
self._dependency_processor =
SQLAlchemy: 0.5.2
SQLite: 3.5.9
MySQL: 5.0.67-0ubuntu6
To short. The problem is 'The result come differently from session's
query and plain sql which built by session's query.'
Well... It is too difficult to explain the situation so just have a
look my code first please.
subquery =
Hi guys! Here goes the code sample:
from sqlalchemy import create_engine, MetaData
from sqlalchemy import Table, Column, ForeignKey, Integer
from sqlalchemy.orm import sessionmaker, mapper, relation
metadata = MetaData()
engine = create_engine('sqlite:///:memory:', echo=True)
parent_table =
Ive made an adjustment in r5720 such that _expire_state() will exclude
unloaded, deferred attribute names from the list of attributes to
expire. So deferreds won't load in that specific case. Otherwise,
explicitly expiring the deferred attribute or expiring when the
deferred attribute
label() is quoting isnull because isnull is listed as a reserved
word. literal_column(isnull) is not, because literal_column does
exactly what you say.
So id try first not using the word isnull for the label. After
that, its possible that SQlite isnt going to let you allow ordering by
1 - changing isnull to foo worked. thanks!
2 - i tried adding text('nulls last') in the order_by(...), but got an
error from sqlite. i don't suppose there's something clever in
sqlalchemy that does this in a portable way is there?
3 - what do you use as a reference for SQL? do you have the
the case solution works too, which is what i'll go with. thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from
Hi,
I am developing a web app using SQLite (which I will switch to
PostgreSQL in production) and came across a weird select error when
using schema. The attached file test.py reproduces the error and
output.txt is the output from running the script.
I have tested with 0.4.2p3 and trunk r4097.
Yep. That was it. Stupid me...
On Nov 13, 4:10 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Nov 13, 2007, at 8:25 AM, Koen Bok wrote:
Hi, I have this strange bug or problem...
I have a basic class like this mapped to a table with the same name.
Metatype is a relation to the metatype
On Nov 13, 2007, at 8:25 AM, Koen Bok wrote:
Hi, I have this strange bug or problem...
I have a basic class like this mapped to a table with the same name.
Metatype is a relation to the metatype object.
class MetaData(DBObject):
def __init__(self, metatype, value, item):
all the default SQL functions are being executed inline here. so
it doesnt like aggregates like max being placed into defaults like
that.
the best I can do for you here, other than rolling back the entire
inilne default thing, would look like this:
Column('foo', Integer,
Tried that, but it just places the select statement within the insert
statement without brackets:
2007-09-06 18:00:57,603 INFO sqlalchemy.engine.base.Engine.0x..90
INSERT INTO request (id, metanumberstate) VALUES (%(id)s, SELECT
coalesce(max(metanumber.id), %(coalesce)s)
FROM metanumber)
OK that one is fixed in r3467.
On Sep 6, 2007, at 12:02 PM, Koen Bok wrote:
Tried that, but it just places the select statement within the insert
statement without brackets:
2007-09-06 18:00:57,603 INFO sqlalchemy.engine.base.Engine.0x..90
INSERT INTO request (id, metanumberstate) VALUES
This is the error: Note that the first param is an SA object instead of
the integer key.
sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt 'SELECT
records_tinwsys.tinwsys_st_code AS records_tinwsys_tinwsys_st_code,
records_tinwsys.tinwsys_is_number AS
Surprised no one has hit this one yet.
When issuing a series of deletes in a UOW, SA issues the bogus delete
statement
DELETE child where id = [1,2,3]
instead of using IN()
Test case attached. Seems to work in Sqlite even while issuing the bogus SQL
(which is probably why a unit test
32 matches
Mail list logo