Skip to content

Instantly share code, notes, and snippets.

@amotl
Last active February 13, 2025 20:19
Show Gist options
  • Save amotl/0122692517a1ec74c44a6c266b6644e8 to your computer and use it in GitHub Desktop.
Save amotl/0122692517a1ec74c44a6c266b6644e8 to your computer and use it in GitHub Desktop.
Validate CrateDB SQLAlchemy connect timeout
import sqlalchemy as sa
TIMEOUT = 0.00001
if __name__ == "__main__":
engine = sa.create_engine('crate://localhost/', connect_args={"timeout": TIMEOUT})
c = engine.connect()
result = c.execute(sa.text("SELECT 42;"))
print(result.all())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment