Hi All,
I have a few partitioned tables in my PostgreSQL database but I do not know
yet how to make the ORM relationship() with partition
constraint-exclusionhttp://www.postgresql.org/docs/9.3/static/ddl-partitioning.html#DDL-PARTITIONING-CONSTRAINT-EXCLUSION
on
the instance level.
Never mind,
the problem was that I specified the clause in a secondaryjoin and not in
the primaryjoin of the relationship().
On Thu, Dec 5, 2013 at 10:44 AM, Adrian adrian.schre...@gmail.com wrote:
Hi All,
I have a few partitioned tables in my PostgreSQL database but I do not
know yet how
ok, let's see if I can explain the scenario better :D
first, i'm using schematics http://schematics.readthedocs.org/ to
define arbitrary models for message exchange between processes, ui,
events and so on. based on a json schema (that the schematics model
generates), i'm able to store data on
Hello Michael,
Michael Bayer mike_mp at zzzcomputing.com writes:
the TsVector type looks perfect!
if you were to package that up for inclusion, it would likely subclass
TypeEngine and you’d implement
PGTypeCompiler.visit_TSVECTOR.we appear to have a little bit of
“tsvector” code
hi all!
another question: i have a postgres database, and i would like to work
with schemas for module models. so far so good, but i didn't find much
information besides it is available in sa docs.
so, i came into this:
On Dec 5, 2013, at 6:57 AM, Adrian Schreyer adrian.schre...@gmail.com wrote:
Actually that was a bit too early but I tracked the problem down to the
many-to-many relationship. Parameters are only interpolated (e.g.
%(param_1)s) for the primaryjoin to the secondary table. Is there a
here’s an example, works on this end:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class AltSchema(object):
__table_args__ = {schema: test_schema}
class A(AltSchema, Base):
__tablename__ = 'a'
this is a really great idea! thanks for asking this question.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to
ha! thanks Mike!
i must have been stupid somewhere. i could say that i did that but,
since it didn't worked then, i can say that my code was wrong somehow :)
my best regards,
richard.
On 12/05/2013 01:37 PM, Michael Bayer wrote:
here’s an example, works on this end:
from sqlalchemy
well ... i'm glad i helped you somehow, even though it was a question :D
cheers,
richard.
On 12/05/2013 01:40 PM, Jonathan Vanasco wrote:
this is a really great idea! thanks for asking this question.
--
You received this message because you are subscribed to the Google
Groups sqlalchemy
Hi Folks,
Is the order ORM events (
http://docs.sqlalchemy.org/en/rel_0_9/orm/events.html ) are fired in
deterministic and guaranteed to be the same every time? I've searched the
docs and google but couldn't anything relating to their relative order.
Cheers,
Tim
--
You received this
On Dec 5, 2013, at 6:16 AM, Richard Gerd Kuesters rich...@humantech.com.br
wrote:
ok, let's see if I can explain the scenario better :D
first, i'm using schematics http://schematics.readthedocs.org/ to define
arbitrary models for message exchange between processes, ui, events and so
on.
Hi there, in one application I am using sqlalchemy 0.7.8 against Oracle
11 release 1 and I am hitting Oracle's lost contact more times than I
would like to. Since the app seems unable to recover from the error, I
have to restart it completely (it is a pyramid app).
According to this
On Dec 5, 2013, at 10:51 AM, Tim Kersten t...@io41.com wrote:
Hi Folks,
Is the order ORM events (
http://docs.sqlalchemy.org/en/rel_0_9/orm/events.html ) are fired in
deterministic and guaranteed to be the same every time? I've searched the
docs and google but couldn't anything
Given the three mappings *First*, *Second* and *Partitioned*, I want to
declare a relationship between *First* and *Partitioned*. The problem is
that *Partitioned* is partitioned by partition_key which is a column in
*First* but not in *Second*. *Second* however contains the identifier that
On Dec 5, 2013, at 10:54 AM, Mariano Mara mariano.m...@gmail.com wrote:
Hi there, in one application I am using sqlalchemy 0.7.8 against Oracle 11
release 1 and I am hitting Oracle's lost contact more times than I would like
to. Since the app seems unable to recover from the error, I have
oh, you want to refer to the tertiary table in both the primary and secondary
join.so right this pattern does not correspond to the A-secondary-B
pattern and isn’t really a classic many-to-many.
a quick way to map these are to use non primary mappers (was going to just
paraphrase, but let
the vertical mapper example was kind of a base for me to develop my
eav system. i have added also a table that defines the structure of
the entity, since then I use schematics (and its json schema import -
export utility). it's very handy.
i think that a pseudo-code can explain a little
thank you.
What of the relative ordering of the different ORM event types? i.e.
before_flush
before_delete
after_flush
etc
When looking at before_flush I see the before_delete has not yet been fired,
yet is has been fired in the after_flush. Is this guaranteed to always be the
case?
On 5
On Dec 5, 2013, at 12:14 PM, Tim Kersten t...@io41.com wrote:
thank you.
What of the relative ordering of the different ORM event types? i.e.
before_flush
before_delete
after_flush
etc
When looking at before_flush I see the before_delete has not yet been fired,
yet is has been
i'm looking at moving some raw sql in twisted to SqlAlchemy and have a
question.
I have a multi-threaded twisted daemon that tends to generate a lot of race
conditions on a few tables that are frequently hit.
I get integrity errors from something like this :
domain = SELECT * FROM
The partitioned relationship actually referred to the tertiary table in
both the primary and secondary join - the problem for me was that in the
primaryjoin
primaryjoin=and_(First.first_id==Second.first_id,
First.partition_key==Partitioned.partition_key)
only First.first_id will be interpolated
also note if you really want to prevent disconnects at the top of a
transaction, you can use a pessimistic approach, see
http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html?highlight=pessimistic#disconnect-handling-pessimistic
.
On Dec 5, 2013, at 11:05 AM, Michael Bayer
On Dec 5, 2013, at 2:24 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 5, 2013, at 1:25 PM, Jonathan Vanasco jonat...@findmeon.com wrote:
i'm looking at moving some raw sql in twisted to SqlAlchemy and have a
question.
I have a multi-threaded twisted daemon that tends to
On jue 05 dic 2013 16:19:14 ART, Michael Bayer wrote:
also note if you really want to prevent disconnects at the top of a
transaction, you can use a pessimistic approach, see
http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html?highlight=pessimistic#disconnect-handling-pessimistic
.
I will try this out then, thanks for your help! I assume this works in 0.9
only?
On Thu, Dec 5, 2013 at 7:18 PM, Michael Bayer mike...@zzzcomputing.comwrote:
With the example I gave, when accessing .partitioned on a First instance,
the lazy loader will convert all columns from “First” into a
it should work in 0.8 as well (and can be done even in 0.7 with some
adjustments), just not the more optimized nested JOIN part.
On Dec 5, 2013, at 2:41 PM, Adrian Schreyer adrian.schre...@gmail.com wrote:
I will try this out then, thanks for your help! I assume this works in 0.9
only?
oh that's great - I didn't expect SqlAlchemy to aggregate/support the
different driver errors like that!
thanks so much, Michael!
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it,
Hi,
I'm trying to create the following index (on PostgreSQL) with SQLAlchemy
0.8:
CREATE INDEX doc_idx ON xmltab (CAST((xpath('//@bla', doc))[1] AS TEXT));
(where doc is a column of type XML)
I got this far:
Index(doc_idx, cast((func.xpath('//@bla', xmlTable.c.doc))[1], TEXT))
but get the
On Thu, Dec 05, 2013 at 10:25:46AM -0800, Jonathan Vanasco wrote:
i'm looking at moving some raw sql in twisted to SqlAlchemy and have a
question.
I have a multi-threaded twisted daemon that tends to generate a lot of race
conditions on a few tables that are frequently hit.
I get
I think if you give your func.xpath a datatype of pg.ARRAY(of whatever) you’ll
get it:
func.xpath(…, type_=postgresql.ARRAY)[1]
from sqlalchemy import func, String
from sqlalchemy.dialects import postgresql
print func.xpath('something', 'somethingelse',
Overall the different pieces aren’t making sense entirely.
We have the notion of a “schema”, stored in the database - that is,
Entity/Attribute. Those tables are fixed per type. It can tell me for example
that there’s a “Person” type with two attributes associated, “name” and
“website”.
So
Thanks for the quick reply. Getting closer...
I changed the code to
idx = Index(doc_idx, cast((func.xpath('//@bla', xmlTable.c.doc,
type_=postgresql.ARRAY(String([1].compile(dialect=postgresql.dialect()),
TEXT))
idx.create(engine)
and the first line is now OK. But the second line
OK well the compile(dialect=…) was just to illustrate the string form, we don’t
put that in the Index, so that way the expression still provides access to the
column, which it needs to search for in order to get at the table:
xmlTable = Table('xmltable', m, Column('doc', TEXT))
idx =
I see, thanks for clarifying.
I think it fails in PG because of a missing pair of parentheses. SA
generates:
CREATE INDEX doc_idx ON xmltab (CAST(xpath('//@value_dbl', doc)[1] AS TEXT))
but it should be:
CREATE INDEX doc_idx ON xmltab (CAST((xpath('//@value_dbl', doc))[1] AS
TEXT))
Subtle
parens can be forced using Grouping
from sqlalchemy.sql.expression import Grouping
idx = Index(doc_idx,
cast(
Grouping(func.xpath(
'//@bla',
xmlTable.c.doc,
type_=postgresql.ARRAY(String())
Wonderful, that did it! Thanks so much.
On Thursday, December 5, 2013 3:01:04 PM UTC-8, Michael Bayer wrote:
parens can be forced using Grouping
from sqlalchemy.sql.expression import Grouping
idx = Index(doc_idx,
cast(
Grouping(func.xpath(
37 matches
Mail list logo