mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 17:27:10 +00:00
38 lines
747 B
Markdown
38 lines
747 B
Markdown
# Python Bindings Examples
|
|
|
|
## Prerequisites
|
|
|
|
Build and install the Python bindings:
|
|
|
|
```bash
|
|
cd bindings/python
|
|
pip install maturin
|
|
maturin develop
|
|
```
|
|
|
|
## basic.py
|
|
|
|
Basic example demonstrating local embedded database usage.
|
|
|
|
```bash
|
|
python examples/basic.py
|
|
```
|
|
|
|
## concurrent_writes.py
|
|
|
|
MVCC mode: 16 concurrent writers using `BEGIN CONCURRENT` with conflict retry.
|
|
|
|
```bash
|
|
python examples/concurrent_writes.py
|
|
```
|
|
|
|
## sync_example.py
|
|
|
|
Demonstrates syncing with Turso Cloud, including optional remote encryption support.
|
|
|
|
```bash
|
|
export TURSO_REMOTE_URL="http://your-db.localhost:8080"
|
|
export TURSO_AUTH_TOKEN="your-auth-token" # optional
|
|
export TURSO_REMOTE_ENCRYPTION_KEY="base64-encoded-key" # optional
|
|
python examples/sync_example.py
|
|
``` |