A SQLAlchemy dialect for Couchbase Analytics/Columnar.
Project description
Couchbase SQLAlchemy
Couchbase dialect for SQLAlchemy to Couchbase Analytics/Columnar. 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) 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.
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
Built Distribution
File details
Details for the file couchbase_sqlalchemy-1.0.0.tar.gz
.
File metadata
- Download URL: couchbase_sqlalchemy-1.0.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d41c60ed43c413d818f101df8a2b081e715c3cd1da91e3a16b10bedb2dac7da |
|
MD5 | 56bd2a48318a2ca9a97e721da88e25b8 |
|
BLAKE2b-256 | b0111a56c7942c241e95fa6c9a9a82fc446a63771b38ceac87e1a612fc6f067f |
File details
Details for the file couchbase_sqlalchemy-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: couchbase_sqlalchemy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b69edb75004257cbbc0cc1dabf2ab11e7beb40affe3ac59a25976a5996f0ea23 |
|
MD5 | 8ee1c8580a746275b7d61221ca07e5ae |
|
BLAKE2b-256 | b94277df3878281f61f299fd2b9f2cc9803b12fa7c4a2a0131e0a453fda3d26c |