Re: [sqlalchemy] missing schema authorization clause

2023-04-07 Thread sumau
Thanks Mike that works perfectly.

Regards
Soumaya

On Wednesday, 5 April 2023 at 23:44:35 UTC+1 Mike Bayer wrote:

> I've never heard of this concept before so a google into stack overflow 
> shows 
> https://stackoverflow.com/questions/10994414/missing-authorization-clause-while-creating-schema,
>  
> where you are probably looking for:
>
> with engine.begin() as conn:
> conn.execute(text("create user {schema_name} identified by 
> {password}"))
>
>
>
> On Wed, Apr 5, 2023, at 6:26 PM, sumau wrote:
>
> Hello
>
> Is it possible to pass in the authorization when creating a schema with 
> the oracle dialect?
>
> oracle_engine = create_engine(
> f"oracle://{user}:{password}@{host}:{port}/{database_name}"
> )
> inspector = inspect(oracle_engine)
> if schema_name not in inspector.get_schema_names():
> oracle_engine.execute(CreateSchema(schema_name))
>
> I tried to pass in the authorization as a kw variable but no luck:
>
> if schema not in inspector.get_schema_names():
> connectable.execute(CreateSchema(schema), authorization=user)
>
> Regards
> Soumaya
>
>
> -- 
> 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+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/ff2f5a13-c17c-43ea-a469-041a306a2e62n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/6a1ba499-2521-4892-92cc-ee96c0a030a1n%40googlegroups.com.


Re: [sqlalchemy] missing schema authorization clause

2023-04-05 Thread Mike Bayer
I've never heard of this concept before so a google into stack overflow shows 
https://stackoverflow.com/questions/10994414/missing-authorization-clause-while-creating-schema,
 where you are probably looking for:

with engine.begin() as conn:
conn.execute(text("create user {schema_name} identified by {password}"))



On Wed, Apr 5, 2023, at 6:26 PM, sumau wrote:
> Hello
> 
> Is it possible to pass in the authorization when creating a schema with the 
> oracle dialect?
> 
> oracle_engine = create_engine(
> f"oracle://{user}:{password}@{host}:{port}/{database_name}"
> )
> inspector = inspect(oracle_engine)
> if schema_name not in inspector.get_schema_names():
> oracle_engine.execute(CreateSchema(schema_name))
> 
> I tried to pass in the authorization as a kw variable but no luck:
> 
> if schema not in inspector.get_schema_names():
> connectable.execute(CreateSchema(schema), authorization=user)
> 
> Regards
> Soumaya
> 
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/ff2f5a13-c17c-43ea-a469-041a306a2e62n%40googlegroups.com
>  
> .

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/88deed52-d70f-4905-8832-03efca819237%40app.fastmail.com.


[sqlalchemy] missing schema authorization clause

2023-04-05 Thread sumau
Hello

Is it possible to pass in the authorization when creating a schema with the 
oracle dialect?

oracle_engine = create_engine(
f"oracle://{user}:{password}@{host}:{port}/{database_name}"
)
inspector = inspect(oracle_engine)
if schema_name not in inspector.get_schema_names():
oracle_engine.execute(CreateSchema(schema_name))

I tried to pass in the authorization as a kw variable but no luck:

if schema not in inspector.get_schema_names():
connectable.execute(CreateSchema(schema), authorization=user)

Regards
Soumaya

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/ff2f5a13-c17c-43ea-a469-041a306a2e62n%40googlegroups.com.