Hope that Alembic can support automatic migrations for Dameng Database. #1753
Unanswered
Martin0318
asked this question in
Usage Questions
Replies: 1 comment
-
|
Hi, Support for alembic is usually provided by the external driver for sqlalchemy for the target database, see for example the CockroachDB dialect https://github.com/cockroachdb/sqlalchemy-cockroachdb: https://github.com/cockroachdb/sqlalchemy-cockroachdb/blob/5b340b66844cb00aaa64fc7a8055786bbfec9dbd/sqlalchemy_cockroachdb/base.py#L603 we are currently not planning on adding builtin support for other dialect other than the ones that are already there |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the use case
Alembic is a widely used database migration tool in the SQLAlchemy ecosystem. However, it currently lacks native support for Dameng Database, a popular domestic relational database . Users would like Alembic to recognize Dameng’s SQL dialect and support automatic generation and execution of migration scripts based on model changes—such as creating tables, altering columns, adding indexes, and other common DDL operations—providing a migration experience comparable to that of PostgreSQL, MySQL, or other mainstream databases.
Databases / Backends / Drivers targeted
Database: Dameng Database (versions V8 and above recommended)
Driver: Official Python DBAPI driver (dmPython) or compatible third-party drivers
SQLAlchemy Dialect: A corresponding SQLAlchemy dialect (e.g., sqlalchemy-dameng) would be required if not already available
Example Use
Assume a user defines the following SQLAlchemy model:
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
tablename = 'users'
id = Column(Integer, primary_key=True)
name = Column(String(50), nullable=False)
When running:
alembic revision --autogenerate -m "create users table"
Additional context
Dameng Database is a domestically developed relational database and is extensively adopted in government, finance, energy, and other critical sectors.
Currently, the lack of official Alembic support for Dameng forces developers to write DDL scripts manually, significantly reducing development efficiency and maintainability. While some community efforts have emerged to create unofficial SQLAlchemy dialects for Dameng, they are not yet integrated into Alembic’s autogenerate framework. Official or community-driven support for Dameng in Alembic would greatly enhance the tool’s inclusivity and better serve users in regulated or localized environments.
Have a nice day!
Beta Was this translation helpful? Give feedback.
All reactions