OceanBase sqlalchemy dialect
Project description
OceanBase Python Client
A OceanBase client for the Python programming language.
OceanBase is an enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards.
Installation
pip install oceanbase_py
SQLAlchemy Usage
To connect to OceanBase using SQLAlchemy, use a connection string (URL) following this pattern:
- User: User Name
- Password: Password
- Host: host
- Port: port
- Database: Database Name
Here's what the connection string looks like:
oceanbase://<User>:<Password>@<Host>:<Port>/<Database>
oceanbase_py://<User>:<Password>@<Host>:<Port>/<Database>
oceanbase://<User>:<Password>@<Host>:<Port>/<Owner>
oceanbase_py://<User>:<Password>@<Host>:<Port>/<Owner>
Example
It is recommended to use python 3.x to connect to the OceanBase database, eg:
from sqlalchemy import create_engine
from sqlalchemy.schema import Table, MetaData
from sqlalchemy.sql.expression import select, text
engine = create_engine('oceanbase://root:xxx@localhost:8081/db')
connection = engine.connect()
rows = connection.execute(text("SELECT * FROM test")).fetchall()
Limits
- Oracle tenants are not currently supported.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oceanbase_py-0.0.1.2.tar.gz
(9.3 kB
view details)
Built Distribution
File details
Details for the file oceanbase_py-0.0.1.2.tar.gz
.
File metadata
- Download URL: oceanbase_py-0.0.1.2.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0af29a49bfbc7dafb9d1c686189b8607269ffc53382ba82fd7eb9ce287f2e70 |
|
MD5 | 41bc52143d5676db058bf41fc89a42c7 |
|
BLAKE2b-256 | 27e17bc5c99ebdf4e486eaf89cd80d93bbe6737060668b504cbd706e4657a529 |
File details
Details for the file oceanbase_py-0.0.1.2-py3-none-any.whl
.
File metadata
- Download URL: oceanbase_py-0.0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f507cb8e3ea4f150e0ae74971cc7b1a34c649af020c34fb82d85e661b5a8fc5 |
|
MD5 | 63f7344263c8ffae3c96f190c24312a8 |
|
BLAKE2b-256 | 9f31471360146ab62829d8ed74d49c86a900f3919b897bdf1b599b99d249a022 |