Couchbase SQLAlchemy
Couchbase dialect for SQLAlchemy to Couchbase Analytics. A Python client library for Couchbase Analytics, couchbase-sqlalchemy provides a comprehensive DB-API and SQLAlchemy dialect implementation for Couchbase.
Installing Couchbase SQLAlchemy
The Couchbase SQLAlchemy package can be installed from the public PyPI repository using pip:
pip install --upgrade couchbase-sqlalchemy
Run a Simple query
1.Creatge a file (e.g. test.py) that contains the following Python sample code, which connects to Couchbase Analytics and displays a simple locate function query:
import urllib.parse from sqlalchemy import create_engine # Define the Couchbase connection string (replace with your details) COUCHBASE_URL = 'couchbase://<username>:<password>@<host>:<port>?ssl=false' # Create the engine for Couchbase using the Couchbase SQLAlchemy dialect engine = create_engine(COUCHBASE_URL) query_result = engine.execute("select locate('something','there is something good');") result = query_result.fetchall() print(result)
Replace <your_user_login_name>, <your_password>, and <host> and <port> with the appropriate values for your Couchbase account and user.
Execute the sample code. For example, if you created a file named test.py:
python test.py
License
Couchbase SQLAlchemy is distributed under the Apache 2.0.
Release files for couchbase-sqlalchemy 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| couchbase_sqlalchemy-1.0.3.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| couchbase_sqlalchemy-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.0 kB
Release files / couchbase_sqlalchemy-1.0.3.tar.gz
| Download URL | couchbase_sqlalchemy-1.0.3.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80c8cca9efb102c03568b920f40af1742ff3c4e0b66ef0f045c4c6b34169d0ed
|
|
BLAKE2b-256 checksum How to use checksums |
b2ce845fb5f2ce9ea7459d2607b9712346b2a79aae67ef747d079a5d602022cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Release files / couchbase_sqlalchemy-1.0.3-py3-none-any.whl
| Download URL | couchbase_sqlalchemy-1.0.3-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
faf9ddcc49cddf12e6168c25f2f935e541c0c10aed5ccc99b3ac50214662b14d
|
|
BLAKE2b-256 checksum How to use checksums |
b2b1202cc5268dd259e77eba9e37af1280a269ffd71ac4a0ab0aee0181f02f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|