The quoted_name tracebacks (i.e. is not enough) with at FOREIGN KEYS, 
probably with other constructs too.

# this works fine
Table(                           
   quoted_name("x", quote=True),        
   metadata, 
   schema=schemaname, 
   autoload=True, 
   extend_existing=True)

# this raises "NoSuchTableError: x"
Table( 
   quoted_name("y", quote=True), 
   metadata, 
   schema=schemaname, 
   autoload=True, 
   extend_existing=True)


It would be useful to have an "always quote all identifiers" (Table, Index, 
Reference, ...) parameter, so that the quoted_name function keeps on being 
applied recursively when nesting-calls any of the following functions:
        self._reflect_column
        self._reflect_pk
        self._reflect_fk
        self._reflect_indexes
        self._reflect_unique_constraints
        self._reflect_...



Il giorno venerdì 2 ottobre 2015 17:12:12 UTC+2, Michael Bayer ha scritto:
>
>
>
> On 10/2/15 9:44 AM, Massimiliano della Rovere wrote:
>
> cx-Oracle==5.2
> SQLAlchemy==1.0.8
>
> I'm in the weird situation of dealing with an Oracle database with 
> lowercase identifiers (they were created by another software that escapes 
> always table/schema/index identifiers).
>
> I get a "NoSuchTableError" whenever I issue a 
>
> MetaData(bind=engine, reflect=True) 
>
> or a
>
> Table( 
>     "tablename",
>     metadata, 
>     schema="SCHEMA", 
>     autoload=True, 
>     extend_existing=True, 
>     quote=True)
>
> statement and it doesn't change whether the "quote" parameter is added or 
> not.
>
> Is there a way to make SQLAlchemy escape identifiers always, without case 
> mangling?
>
>
> you get NoSuchTable on straight MetaData(reflect=True)?    Please post a 
> bug report with the full table def I'd have to test that.   
>
> using quoted_name will definitely quote the value: 
> http://docs.sqlalchemy.org/en/rel_1_0/core/sqlelement.html?highlight=quoted#sqlalchemy.sql.elements.quoted_name
>
>
>
>
>
>
>
> Thanks
> -- 
> 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 [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to