Support a URI attribute from created engine
jameshgrn opened this issue · 6 comments
Is your feature request related to a problem? Please describe.
SQL Alchemy allows users to grab the URI of the sql engine (sql_engine.url) for example. Some packages require the URI instead of an engine object.
Describe the solution you'd like
I would like the engine created to have a URI attribute that returns the string representation of the connection
Describe alternatives you've considered
No way to get past this as far as I can tell.
@jameshgrn
Thank you for creating this issue.
I don't know the feature.
Would you please show me an example or SQL Alchemy reference document? implementation of other libraries may help us.
The engine has 'url' attribute.
What did you expect to return it?
engine = create_engine( 'mysql+pydataapi://', connect_args={ 'resource_arn': 'arn:aws:rds:us-east-1:123456789012:cluster:dummy', 'secret_arn': 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy',
'database': 'test'} )
print(engine.url)
# mysql+pydataapi://
@koxudaxi thank you for the package! It's great
I'm thinking of this example
where the engine class has an attribute 'url'
@jameshgrn
Thank you for the link.
What URL should I set?
My idea is this.
{db_type}+pydataapi://{resouse_arn}/{secret_arn}/{database}
Example:
mysql+pydataapi://arn:aws:rds:us-east-1:123456789012:cluster:dummy/arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy/test
Or, Did you expect traditional DB URI?
Example:
mysql://fed_user@remote_host:9306/federated/test_table
I'm not sure, let's try the traditional DB URI?
Following up, let me try each of these out in a use case and get back to you
@jameshgrn
I'm trying to add url
attribute. But, I don't know how to set the value on the created engine.
I keep working on it.