--- id: starrocks version: "1.3.4" license: Apache-2.0 license_treatment: permissive maintenance: active --- # starrocks — Python SQLAlchemy Dialect for StarRocks with optional Alembic integration License: permissive · Maintenance: active · Downloads: 581.8K/mo ## What it is and what it does This package is a SQLAlchemy dialect that bridges Python applications to StarRocks, a next-generation real-time analytics database. It allows developers to use SQLAlchemy's ORM and expression language to query and manage StarRocks tables, as well as define tables with StarRocks-specific attributes like primary keys, distribution strategies, and replication settings. The package also integrates with Alembic to automate schema migrations, including support for views and materialized views. The dialect supports both synchronous connections (via pymysql) and asynchronous connections (via asyncmy2), making it suitable for both traditional and async Python applications. It includes helpers for defining views and materialized views, and can generate migration code from existing database schemas. The package is actively maintained and targets modern Python versions from 3.10 to 3.14. Use it for: - Build a Python web application that queries StarRocks for real-time analytics dashboards using SQLAlchemy ORM. - Automate schema migrations in a StarRocks data warehouse using Alembic without writing raw SQL. - Define and manage complex StarRocks tables with distribution and replication settings via SQLAlchemy declarative models. - Integrate async Python applications (e.g., FastAPI services) with StarRocks using the asyncmy driver. - Generate Python ORM models from an existing StarRocks database schema using sqlacodegen. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a SQLAlchemy dialect and Alembic integration for connecting Python applications to StarRocks, a real-time analytics database platform. Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and provides a well-integrated path into StarRocks for Python developers already using SQLAlchemy. Install it if you need to connect a Python application to StarRocks; the low friction and permissive license make it a straightforward choice. ## Install pip install starrocks uv add starrocks poetry add starrocks ## Installing starrocks Before you install: Low friction install with a pure-Python wheel. Maintained actively with a recent release and high repository engagement. Requires Python 3.10 or later and depends on stable, widely-used libraries (sqlalchemy, pymysql, lark, alembic, asyncmy2). License in practice: Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions. Quickstart: pip install starrocks from sqlalchemy import create_engine, text engine = create_engine('starrocks://root@localhost:9030/mydatabase') with engine.connect() as connection: rows = connection.execute(text("SELECT * FROM mytable LIMIT 2")).fetchall() print(rows) Requires Python >= 3.10, <= 3.14; StarRocks server must be running and accessible at the specified host and port. Verify before relying: - Whether asyncmy2 is a typo for asyncmy or a distinct package; the dependency list shows 'asyncmy2' but documentation references 'asyncmy'. - Performance characteristics and connection pooling behavior under high concurrency. - Completeness of StarRocks-specific DDL support (e.g., all table properties, index types, partition strategies). ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 581.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sqlalchemy dialect starrocks, python starrocks client, starrocks database connection, alembic schema migration starrocks, async sqlalchemy starrocks, orm starrocks python, starrocks asyncmy driver, sqlalchemy-dialect, analytics-database, schema-migration [View on SkillFed](https://skillfed.io/packages/starrocks) · [View on PyPI](https://pypi.org/project/starrocks/)