On 05/18/2017 08:42 PM, ben4ever wrote:
I'm writing a Progress OpenEdge dialect and when experimenting with the dialect's default_schema_name I noticed that it is not automatically used when creating a MetaData object without specifying a schema. Here is an example where the SELECT statement does not include the schema name specified in default_schema_name:
|
from urllib.parse import quote

from sqlalchemy import create_engine, select, Table, Column, Integer, MetaData
import sqlalchemy_progress

connect_string = 'progress:///?odbc_connect={}'.format(quote(
     'DRIVER=progress;DB=bizcomm;HOST=hostname;PORT=1234;UID=admin'))
engine = create_engine(connect_string, echo=True)

metadata = MetaData()
foo = Table('foo', metadata,
     Column('f1', Integer),
     Column('f2', Integer))

print(engine.connect().execute(
         select([foo.c.f1])
     ).fetchall())
|

Is this the intended behaviour?

yes. the "default" schema means, the *database's* default schema. that is, if you refer to a table without a schema name, that's the schema it will actually use.





--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
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 <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 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 this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to