Background: Using core we have tables defined in a few separate files.
Goal: To have column defaults be selectables which reference other tables
while avoiding circular imports. To avoid circular imports I cannot always
build the selects at import time, they have to be generated inside a
>
> so my sudo code for where is where dramt.key = '1'.
>
.where(or_(table.c.dramt.has_key('1'), table.c.cramt.has_key('1')))
This only works for JSONB.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop
er.process(select([table_b]).as_scalar())
>
> m = MetaData()
>
>
> table_a = Table(
> 'a', m,
> Column('id', Integer),
> Column('data', Integer, default=MyThing())
> )
>
> table_b = Table(
> 'b', m,
> Column('id', Intege
We're just using core, is there some equivalent?
On Thursday, March 17, 2016 at 3:19:23 PM UTC-6, Mike Bayer wrote:
>
>
>
> On 03/17/2016 04:47 PM, Jonathan Beluch wrote:
> > Background: Using core we have tables defined in a few separate files.
> > Goal: To have column
already a
> Connection, is "branched", meaning it is safe to call close() on it
> without affecting the original.
>
> So fully:
>
> with engine_or_connection.connect() as conn:
> with conn.begin() as trans:
> # etc.
>
>
> On 02/23/2016 1
Actually my example isn't fully correct for the case of passing in a
connection not in a transaction but the question remains.
On Tuesday, February 23, 2016 at 9:05:03 PM UTC-7, Jonathan Beluch wrote:
>
> Is there a better way of doing this? Basically I have a function that
&
Is there a better way of doing this? Basically I have a function that takes
a connectable (engine or connection) and I want to start a transaction.
However I can't just call .begin() because it could return a Transaction or
a Connection depending on what was passed in and I need a connection.
Not sure about other DBs, but according to pg docs [1], it's preferred to
make a unique constraint (and know that you get the index for free) versus
creating a unique index.
Knowing this for pg, you can just do unique=True and get the constraint and
the index. I realize this is a very small
I'm having a problem with indexes whose name is longer than
max_identifier_length and the comparisons during --autogenerate.
The index on the code/metadata side is being compared using its
auto-generated naming convention name, which doesn't take into account the
max_identifier_length since
>
> In the meantime, the standard way to control what autogenerate considers
> is using the include_object callable:
>
>
> http://alembic.readthedocs.org/en/latest/api/runtime.html#alembic.runtime.environment.EnvironmentContext.configure.params.include_object
>
>
> here, you can even call the
Hi, using sqlalchemy 1.0.9 and python 2.7.10.
import sqlalchemy as sa
meta = sa.MetaData()
table = sa.Table('mytable', meta,
sa.Column('foo', sa.String),
sa.Column('bar', sa.String, default='baz'),
)
select = sa.select([table.c.foo])
insert = table.insert().from_select(['foo'], select,
11 matches
Mail list logo