you can always make any connect style work immediately like this:


import cx_Oracle

def creator():
    return cx_Oracle.connect("/@PROD")

engine = create_engine("oracle+cx_oracle://", creator=creator)

however the "/@PROD" connect string is just an empty username/password and PROD for the DSN so the equivalent is this:

engine = create_engine("oracle+cx_oracle://@PROD")


to test what this creates we can use a dialect:

>>> from sqlalchemy.dialects.oracle import cx_oracle
>>> from sqlalchemy.engine import url
>>> u = url.make_url("oracle+cx_oracle://@PROD")
>>> dialect = cx_oracle.OracleDialect_cx_oracle()
>>> args = dialect.create_connect_args(u)
>>> args
([], {'dsn': 'PROD', 'twophase': True, 'user': '', 'threaded': True})


so that means that here, the URL will result in this call:

conn = cx_Oracle.connect(dsn='PROD', user='', twophase=True, threaded=True)

PROD is the DSN here. If cx_Oracle fails to accept it as a keyword argument in this context, that's a bug in cx_Oracle.








On 05/27/2016 11:14 AM, Matt Vasquez wrote:
I am able to get cx_Oracle to connect just fine using the wallet alias:

import cx_Oracle

db = cx_Oracle.connect("/@PROD")
print db.version

db.close()


I just need to know how to put "/@PROD" in a URI format for sqlalchemy..





On Friday, May 27, 2016 at 9:31:35 AM UTC-5, Mike Bayer wrote:

    get it working with regular cx_oracle first.   I'm not familiar with
    external password store so you should ask on the cx_oracle mailing list
    (https://sourceforge.net/p/cx-oracle/mailman/cx-oracle-users/
    <https://sourceforge.net/p/cx-oracle/mailman/cx-oracle-users/>)



    On 05/27/2016 10:18 AM, Matt Vasquez wrote:
    >
    > down votefavorite
    >
    
<https://stackoverflow.com/questions/37471892/using-sqlalchemy-dburi-with-oracle-using-external-password-store#
    
<https://stackoverflow.com/questions/37471892/using-sqlalchemy-dburi-with-oracle-using-external-password-store#>>

    >
    >
    > I am trying to get a oracle sqlalchemy dburi working with an external
    > password store (Oracle Wallet)
    >
    > I have tried using the standard sqlplus syntax for a external
    password
    > store with no luck..
    >
    > |sqlalchemy.dburi="oracle:///@PROD"|
    >
    > I can connect successfully using sqlplus as follows:
    >
    > |sqlplus /@PROD|
    >
    > I can't find any information on how to use external password
    stores with
    > sqlalchemy or turbogears?
    >
    > --
    > 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:>
    > <mailto:[email protected] <javascript:>>.
    > To post to this group, send email to [email protected]
    <javascript:>
    > <mailto:[email protected] <javascript:>>.
    > Visit this group at https://groups.google.com/group/sqlalchemy
    <https://groups.google.com/group/sqlalchemy>.
    > For more options, visit https://groups.google.com/d/optout
    <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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to