Best practice question implementing a sqlalchemy c...
# prefect-getting-started
w
Best practice question implementing a sqlalchemy connector block. I've got a database i want to access via Prefect using SSH (I can already do this via Python using sshtunnel). Each time I create the tunnel, I'll get a new local bind port and address to feed into the SQLAlchemy connection string, so I'll need to create a custom block on the fly. Would best practice be to create an sqlalchemyblock with all the other relevant SQL connection data that is static (user, pass, db, etc. and leave the other parts blank/with a placeholder) then create a new sqlalchemyblock dynamically in the flow using all the static information + the tunnel port and address? Or am I missing a much smarter way to do this?
k
if it's a block you don't need to save, and you already have some of the values you need, you can load the mostly-correct block from Cloud and then adjust its properties as needed at runtime like my_block.thing_i_need_to_change = new_value
smart 1
🙌 1