SQLAlchemy is not a database driver and does not replace pyodbc. If
you are using a database like MS SQL Server, pyodbc is still the default
driver if you are connecting with a URL like "mssql://".Also, an
application can't switch in place from pyodbc to SQLAlchemy,
"installing" is not
On 01/01/2016 01:56 PM, Yegor Roganov wrote:
> Is there an option to make sqlalchemy populate foreign key column(s)
> when a relationship is set?
> Basically I want the following:
>
> child.parent = parent
> assert child.parent_id == parent.id
just call session.flush() and this assertion will
I think that the "set" event is sufficient in most of my use-cases. Thanks!
On Friday, January 1, 2016 at 10:11:45 PM UTC+2, Michael Bayer wrote:
>
>
>
> On 01/01/2016 01:56 PM, Yegor Roganov wrote:
> > Is there an option to make sqlalchemy populate foreign key column(s)
> > when a relationship
Hi all,
I use automap with database reflection to import schema with sqlalchemy.
In case I have two relationships on same foreign key in some table, only
one relationship is created by prepare(), the second one seems overwrited.
My table looks like :
Table('thermostat',
Base.metadata,
Is there an option to make sqlalchemy populate foreign key column(s) when a
relationship is set?
Basically I want the following:
child.parent = parent
assert child.parent_id == parent.id
Here is a full example you can run:
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy
you need to use the name generation functions
name_for_scalar_relationship() and/or name_for_collection_relationship()
to produce different names in each case. The "constraint" parameter
passed as we see in
One of our application was previously running via pyODBC. But it has
several performance issues in high load. So we decided to use SQL Alchemy
instead of pyODBC database adopter. But, after installing the product and
use it to run some ZSQL methods (which involves DML queries like