{"library":"starrocks","title":"StarRocks SQLAlchemy Dialect","type":"library","description":"The `starrocks` library provides a Python SQLAlchemy Dialect and an Alembic extension for interacting with StarRocks, a next-generation data platform designed for fast, real-time analytics. It enables developers to leverage SQLAlchemy's ORM and expression language, and manage database schema migrations with Alembic. The project is actively maintained with releases occurring every few months.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install starrocks"],"cli":null},"imports":["from sqlalchemy import create_engine, text","from starrocks import INTEGER, STRING, ARRAY, ..."],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://starrocks.io","github":"https://github.com/starrocks/starrocks","docs":"https://docs.starrocks.io","changelog":null,"pypi":"https://pypi.org/project/starrocks/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nfrom sqlalchemy import create_engine, text\n\n# Configure connection details via environment variables\nSTARROCKS_USER = os.environ.get('STARROCKS_USER', 'root')\nSTARROCKS_PASSWORD = os.environ.get('STARROCKS_PASSWORD', '')\nSTARROCKS_HOST = os.environ.get('STARROCKS_HOST', 'localhost')\nSTARROCKS_PORT = os.environ.get('STARROCKS_PORT', '9030')\nSTARROCKS_DATABASE = os.environ.get('STARROCKS_DATABASE', 'mydatabase')\n\n# Construct connection string\nconnection_string = (\n    f\"starrocks://{STARROCKS_USER}:\"  # User and optional password\n    f\"{STARROCKS_PASSWORD}@{STARROCKS_HOST}:{STARROCKS_PORT}/\"\n    f\"{STARROCKS_DATABASE}\"\n)\n\n# Create a SQLAlchemy engine\nengine = create_engine(connection_string)\n\ntry:\n    # Establish a connection and execute a basic query\n    with engine.connect() as connection:\n        print(\"Connection successful!\")\n        # Ensure 'mytable' exists in 'mydatabase' for this example\n        result = connection.execute(text(\"SELECT 1 + 1\")).scalar()\n        print(f\"Query result: {result}\")\n        \n        # Example: Fetching data from a table (uncomment and replace if 'mytable' exists)\n        # rows = connection.execute(text(\"SELECT * FROM mytable LIMIT 2\")).fetchall()\n        # print(rows)\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to establish a connection to a StarRocks database using SQLAlchemy's `create_engine` and execute a simple query. It uses environment variables for secure credential management. Ensure you have a running StarRocks cluster and a database configured.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.2.3","pypi_latest":"1.3.3","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4,"avg_import_s":0.64,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.5,"mem_mb":15.5,"disk_size":"67.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.3,"import_time_s":0.38,"mem_mb":15.5,"disk_size":"69M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.78,"mem_mb":17.6,"disk_size":"73.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4,"import_time_s":0.67,"mem_mb":17.6,"disk_size":"76M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.83,"mem_mb":17.4,"disk_size":"64.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.6,"import_time_s":0.82,"mem_mb":17.4,"disk_size":"68M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.83,"mem_mb":17.6,"disk_size":"64.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.7,"import_time_s":0.74,"mem_mb":17.6,"disk_size":"67M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.46,"mem_mb":15.1,"disk_size":"45.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"starrocks","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.6,"import_time_s":0.4,"mem_mb":15.1,"disk_size":"45M"}]}}