I'm just not getting it:
Want: select max(id) from table;
attempt (latest):
from sqlalchemy import *
from sqlalchemy.engine import reflection
from sqlalchemy import schema
from sqlalchemy import exc
from psycopg2 import *
import re
import time
import os
targethost = "192.168.181.204"
targetdb
See below
On Tuesday, September 8, 2015 at 9:00:12 PM UTC-4, Michael Bayer wrote:
>
>
>
> you can get these like this:
>
> from sqlalchemy import inspect
> insp = inspect(my_engine)
>
> fk_constraints = insp.get_foreign_keys('mytable')
> uq_constraints = insp.get_unique_constraints('mytable')
>
On Wednesday, September 30, 2015 at 1:43:46 PM UTC-6, Michael Bayer wrote:
>
> there's no known bugs in fetching unique constraints. PG 8.4 is a pretty
> old version but should be working.
>
> note that a unique index and a unique constraint aren't listed as the same
> thing, however.you
Oh, Michael!
You have made my day. It just gets better and better!
I don't know how I missed these items, but your examples are very helpful.
Many thanks!
On Tuesday, September 8, 2015 at 7:00:12 PM UTC-6, Michael Bayer wrote:
>
>
>
> On 9/8/15 12:57 PM, Steve Murphy wrote:
This message concerns using sqlAlchemy for schema based traversal and
manipulation.
It is the result of a project to transfer data from on database to another,
where objects
refer to each other, and must be copied to new rows in the target db, and
have all the
foreign references updated in
Hmm, I don't think I could listen to the attribute event; it's saying that
the AssociationProxy doesn't have dispatch.
Also, suppose I could detect the orphan-deletes earlier, what's the best
way to suppress the objects marked as dirty?
Here's my version of your code if it helps:
Since my association object doesn't have extra columns, the row ('bob,
'apple') will be deleted. However, if there are extra columns, then having
it marked as dirty is desired.
Perhaps I would delay my recording of my audit rows until after orphans are
resolved. I am already using after_flush,
, it marks the UserKeyword association object is
dirty instead of deleted. Why is that? Since the row is being removed,
I would expect it to be marked as deleted, so that I could make an audit
record indicating it was deleted.
Thanks,
Steve
--
You received this message because you
, in get_by_dialect
return _impls[dialect.name]
KeyError: 'firebird'
Thanks,
Steve
--
You received this message because you are subscribed to the Google Groups
sqlalchemy-alembic group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy-alembic+unsubscr
I realize this thread is ancient, but I'm resurrecting it for Googleable
posterity since I just ran across the same issue.
The problem is that MySQL helpfully inserts the ON UPDATE cheese unless
you specify a default and/or a NULL/NOT NULL value in the CREATE TABLE
query.
My solution, since sqlalchemy seems to be ignoring the nullable and default
kwargs, is this:
time = Column(
TIMESTAMP(), primary_key=True,
server_default=text('-00-00 00:00:00'))
The default is just never used.
On Friday, January 10, 2014 12:20:45 PM UTC-8, Steve
you should only be dealing with timezone-naive datetimes within a
Python application
Thanks - make sense although the klugey way around the problem is just to
commit None before you change between naive and aware since comparisons
with None are fine.
--
You received this message because you are
When I try to commit a timezone aware datetime to replace a value that was
previously timezone naive, I get a TypeError when I try to do the commit
with the message:
TypeError: can't compare offset-naive and offset-aware datetimes
Now I am not trying to compare anything but just store the new
Hi,
Thanks. Worked like a charm.
Also thanks for SqlAlchemy. A refreshing change for someone from java
background.
I am using this with Jython. Thanks for the Jython support also.
Steve
On Jan 18, 8:54 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Jan 18, 2011, at 9:11 AM, Steve wrote
).\
all()
Thanks in advance.
Steve.
--
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 this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For more
?
Steve
--~--~-~--~~~---~--~~
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 this group, send email to
sqlalchemy+unsubscr
)?
Steve
--~--~-~--~~~---~--~~
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 this group, send email to
sqlalchemy+unsubscr
(). [It was missing
in the most recent example but apparently an empty dictionary is fine.]
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
use query.statement to get at the SQL expression
Thanks. That worked.
--~--~-~--~~~---~--~~
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
to a
context_id = 0. Thanks for any advice.
Steve
--~--~-~--~~~---~--~~
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 this group
.
Steve
--~--~-~--~~~---~--~~
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 this group, send email to
sqlalchemy+unsubscr
should I be doing ? Use another syntax ? Replace psycopg2's
paramstyle to non-escaping mode ?
My environment:
Python 2.5.2
SQLAlchemy 0.5.0.rc3
PostgreSQL 8.30
psycopg 2.0.7
Ubuntu 8.04
--
Best Regards,
Steve Howe
--~--~-~--~~~---~--~~
You received this message
-
that confused me.
It's working now, thanks, I needed the ILIKE function.
--
Best Regards,
Steve Howe
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
? Is this the way it should be?
-Steve
--~--~-~--~~~---~--~~
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 this group, send email to [EMAIL
Thanks for the explanation, Michael. The behavior is very sensible
now that I see what's happening.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
Trunk Rev 4726
Note the following:
Python 2.5.2 (r252:60911, May 7 2008, 15:19:09)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
from sqlalchemy import *
Traceback (most recent call last):
File stdin, line 1, in module
File
be sure to clean out the .pyc files.
That worked. 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 this
my hat's off to you for coming up with that relation(), it works again
in rev 4486.
Ah the irony ... check out http://tinyurl.com/6kqv94
And thanks as always for your remarkable responsiveness and for
sqlalchemy. It is indispensible.
Steve
Michael,
Works perfectly. Thanks much.
Steve
--~--~-~--~~~---~--~~
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 this group, send
another option is:
.query(Node).filter(not_(Node.id.in_(select([Node.parent_id]
jason, thanks for the alternative method. Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
is. Any help
would be appreciated.
Steve
--~--~-~--~~~---~--~~
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 this group, send email
Is it possible to create indexes using a function using sqlalchemy and
postgresql?
Something like: create index idx on table (lower(table.field))
Thanks,
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Michael, thanks for working through this and for taking the time to
explain what's going on and to provide alternative ways to getting
this done. Your efforts to support the users of sqlalchemy are really
extraordinary.
--~--~-~--~~~---~--~~
You received this
I may be missing something fundamental here, but why doesn't it
already know the metadata since I defined the columns in which I'm
interested?
thing_table = sa.Table(thing, md, sa.Column('id', sa.Integer,
primary_key = True))
On 3/17/07, Michael Bayer [EMAIL PROTECTED] wrote:
the cursor
, then everyone can just upgrade.
which version are you using?
On Mar 17, 2007, at 8:41 PM, Steve Huffman wrote:
I may be missing something fundamental here, but why doesn't it
already know the metadata since I defined the columns in which I'm
interested?
thing_table = sa.Table(thing
Works perfectly. Your responsiveness and the usefulness of SQLAlchemy
continue to amaze. Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
Works. 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 this group, send email to [EMAIL PROTECTED]
For
Prior to 2089, the following worked fine:
session.query(ItemKeyword).count()
where ItemKeyword has a compound primary key that is defined in its
mapper as follows:
mapper(ItemKeyword, itemkeyword_table, primary_key =
[itemkeyword_table.c.item_uuid, itemkeyword_table.c.keyword_uuid],
youre really looking to have an association object pattern here.
I thought you might recommend that. My problem last time I tried an
association object was that in the following situation:
item table
keyword table
itemkeyword table (and association object)
I couldn't get the keywords to eager
the eager load should be able to go through the association object
down to the endpoint Keyword objects
Thanks -- that does work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this
40 matches
Mail list logo