PaleNeutron / sqlalchemy-oceanbase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sqlalchemy-OceanBase

OceanBase mysql tenant use pymysql to connect to OceanBase database.

See OceanBase Document

But the DDL of OceanBase is slightly different from MySQL, and user will get some warnings when reflecting metadata from OceanBase.

Alembic thus cannot work with OceanBase directly.

This package is a workaround to make Alembic work with OceanBase.

Installation

pip install sqlalchemy-oceanbase

Usage

from sqlalchemy import create_engine

engin = create_engine('msyql+oceanbase://user:password@host:port/dbname')

Async model

from sqlalchemy.ext.asyncio import create_async_engine

engin = create_async_engine('msyql+oceanbase://user:password@host:port/dbname')

About


Languages

Language:Python 100.0%