{"library":"sqlalchemy-vertica","title":"SQLAlchemy Vertica Dialect","type":"library","description":"SQLAlchemy-Vertica provides a dialect for connecting SQLAlchemy to Vertica databases, leveraging the `vertica-python` driver. It allows users to interact with Vertica using SQLAlchemy's ORM and SQL Expression Language. The current version is 0.0.5, and the project appears to be in maintenance mode with infrequent updates.","language":"python","status":"maintenance","last_verified":"Fri Apr 17","install":{"commands":["pip install sqlalchemy-vertica"],"cli":null},"imports":["from sqlalchemy import create_engine"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/lv10/sqlalchemy-vertica","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sqlalchemy-vertica/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nfrom sqlalchemy import create_engine, text\n\n# Replace with your actual Vertica connection details\n# It's recommended to use environment variables for sensitive info.\nVERTICA_USER = os.environ.get(\"VERTICA_USER\", \"dbadmin\")\nVERTICA_PASSWORD = os.environ.get(\"VERTICA_PASSWORD\", \"password\")\nVERTICA_HOST = os.environ.get(\"VERTICA_HOST\", \"localhost\")\nVERTICA_PORT = os.environ.get(\"VERTICA_PORT\", \"5432\")\nVERTICA_DATABASE = os.environ.get(\"VERTICA_DATABASE\", \"VMART\")\n\nconnection_string = (\n    f\"vertica+vertica_python://{VERTICA_USER}:{VERTICA_PASSWORD}\"\n    f\"@{VERTICA_HOST}:{VERTICA_PORT}/{VERTICA_DATABASE}\"\n)\n\ntry:\n    engine = create_engine(connection_string)\n    with engine.connect() as connection:\n        # Example: Execute a simple query\n        result = connection.execute(text(\"SELECT 1 as test_col\"))\n        print(f\"Connection successful! Result: {result.scalar()}\")\nexcept Exception as e:\n    print(f\"Failed to connect or execute query: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to establish a connection to a Vertica database using `sqlalchemy-vertica` and execute a simple SQL query. Ensure `VERTICA_USER`, `VERTICA_PASSWORD`, `VERTICA_HOST`, `VERTICA_PORT`, and `VERTICA_DATABASE` are correctly configured, preferably via environment variables for production systems.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}