or should be a little better
q=q1.union_all(q2,q3)
--
Mike Conley
On Thu, Aug 27, 2009 at 12:14 AM, Mike Conley wrote:
> Did you try something like this?
>
> q1=session.query(P1.userid, P1.extra, P1.title, P1.body)
> q2=session.query(P2.userid, "'X'", P2.title, P2.body)
> q3=session.query(P
Did you try something like this?
q1=session.query(P1.userid, P1.extra, P1.title, P1.body)
q2=session.query(P2.userid, "'X'", P2.title, P2.body)
q3=session.query(P3.userid, "'X'", P3.title, P3.body)
q=q1.union_all(q2).union_all(q3)
--
Mike Conley
On Wed, Aug 26, 2009 at 10:45 PM, Seth wrote
I have three different types of post tables with all of the same
columns except that the first table has an extra column named
"type" (placed in-between the 'user_id' and 'title' columns of the
other tables). I want to do a UNION ALL that will combine the data
from all these tables into a single l
The issue I'm having with the length is that I have a verification
layer written in a mapper extension that verifies the length of what
the user is inserting based on the field length. Guess I'll have to
convert to bytes to determine the actual length of the data to be
inserted.
On Aug 26, 6:01 p
On Aug 26, 2009, at 8:53 PM, chris e wrote:
>
> I just checked the trunk, it the same reflection code is in place, as
> far as the column length is concerned.
>
> To me the question is, should sqlalchemy be aware of Char vs Byte
> storage?
>
> Is VARCHAR2(400) the same as VARCHAR2(100 CHAR), by
I just checked the trunk, it the same reflection code is in place, as
far as the column length is concerned.
To me the question is, should sqlalchemy be aware of Char vs Byte
storage?
Is VARCHAR2(400) the same as VARCHAR2(100 CHAR), by storage size it
is, but do we want storage size or number of
On Aug 26, 2009, at 6:56 PM, chris e wrote:
>
> I noticed that with reflection, my column lengths seems to be
> incorrect for varchar2, and char columns that are using char storage
> instead of byte storage.
>
> I.E. a VARCHAR2(400 CHAR) colum, is reported to have a length of 1600
> by sqlalchem
I noticed that with reflection, my column lengths seems to be
incorrect for varchar2, and char columns that are using char storage
instead of byte storage.
I.E. a VARCHAR2(400 CHAR) colum, is reported to have a length of 1600
by sqlalchemy, as our database uses utf-32 for storage, however, there
Add cascade='delete-orphan' to the relation definition for children.
cascade='all,delete-orphan' is also a fairly common option.
See the documentation for other options in cascade.
http://www.sqlalchemy.org/docs/05/reference/orm/mapping.html#sqlalchemy.orm.relation
--
Mike Conley
On Wed, Au
Hi
How do i define a delete-orphan using declarative base?
I am using sqlite and SA0.5.5
I have defined a one to one relation.
class Child(DeclarativeBase):
__tablename__='children'
id=Column(String(50),primary_key=True)
parent_id=Column(String(50),ForeignKey
('parent.id',onupdate="CAS
OK.
thanks for these answers
On Aug 26, 3:42 pm, Mike Conley wrote:
> Look at the generated SQL. The Python DBAPI uses one INSERT statement for
> all rows inserted when using executemany(). In this case,
> INSERT INTO test (col1, col2) VALUES (?, ?)
> SA created the column list from the first
On Aug 26, 3:20 pm, "King Simon-NFHD78"
wrote:
> > -Original Message-
> > From: sqlalchemy@googlegroups.com
> > [mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato
> > Sent: 26 August 2009 13:40
> > To: sqlalchemy
> > Subject: [sqlalchemy] from a sqlalchemy table to the
Hi all,
i am writing a tool to import MySQL dumps into different databases
(MySQL and PostgreSQL). The tool will create suitable databases and
tables within them, so i wanted to use metadata.create_all() for table
creation.
The dumps are in the collowing format:
--- snip ---
INSERT INTO `catego
On Aug 26, 2009, at 5:36 AM, menuge wrote:
>
> Hi all,
>
> I d like to insert a list of dictionary in a simple MySQL table but, I
> have a problem, in my case, the MySQL default values are not
> supported...
>
> The table is very simple; 2 columns and a default value on the col2:
> ##
> CREA
Look at the generated SQL. The Python DBAPI uses one INSERT statement for
all rows inserted when using executemany(). In this case,
INSERT INTO test (col1, col2) VALUES (?, ?)
SA created the column list from the first set of values provided to
i.insert(), and so supplied a NULL value for col2 in th
> -Original Message-
> From: sqlalchemy@googlegroups.com
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato
> Sent: 26 August 2009 13:40
> To: sqlalchemy
> Subject: [sqlalchemy] from a sqlalchemy table to the
> corresponding CREATE TABLE sql code
>
>
> A part from se
A part from setting echo=True and monitoring the result
of .create_all, is there a more elegant way
to extract the SQL creation code from a table object?
TIA,
M.S.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hi All,
I'm seeing this error:
Module sqlalchemy.engine, line 223, in create_engine
Module sqlalchemy.engine.strategies, line 62, in create
Module sqlalchemy.databases.postgres, line 361, in dbapi
Module None, line 55, in
ImportError: cannot import name tz
...when sqlalchemy and ps
Hi all,
I d like to insert a list of dictionary in a simple MySQL table but, I
have a problem, in my case, the MySQL default values are not
supported...
The table is very simple; 2 columns and a default value on the col2:
##
CREATE TABLE `test` (
`col1` int(11) default NULL,
`col2` int(1
19 matches
Mail list logo