A plugin of nextline-graphql. A relational database for nextline
Project description
nextline-rdb
A plugin for nextline-graphql. A relational database for nextline-graphql.
Table of Contents
Installation
pip install nextline-rdb
Nextline-graphql automatically detects this package as a plugin.
Configuration
Environment variable | Default value | Description |
---|---|---|
NEXTLINE_DB__URL |
sqlite+aiosqlite:// |
The DB URL of SQLAlchemy |
Note: Only tested on SQLite + aiosqlite.
Examples
How to run Nextline-graphql with Nextline RDB
In a virtual environment
Create a virtual environment and install packages.
python -m venv venv
source venv/bin/activate
pip install nextline-graphql
pip install nextline-rdb
pip install uvicorn
Specify the database URL.
export NEXTLINE_DB__URL="sqlite+aiosqlite:///db.sqlite3"
Run on the port 8080.
uvicorn --lifespan on --factory --port 8080 nextlinegraphql:create_app
Check with a web browser at http://localhost:8080/.
In a Docker container
Create a Docker image.
git clone git@github.com:simonsobs/nextline-rdb.git
cd nextline-rdb
docker image build --tag nextline-rdb .
Run on the port 8080 with a file on the host machine db/db.sqlite3
as the
persistent DB.
The directory db/
and the file db.sqlite3
will be created if
they don't exist.
docker run -p 8080:8000 --env NEXTLINE_DB__URL='sqlite+aiosqlite:////db/db.sqlite3' -v "$(pwd)/db:/db" nextline-rdb
Check with a web browser at http://localhost:8080/.
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 nextline_rdb-0.6.10.tar.gz
.
File metadata
- Download URL: nextline_rdb-0.6.10.tar.gz
- Upload date:
- Size: 85.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45fbbc79f9804e973b3f76ae1e16ad6e092296cad19e206860f5c3291886ba61 |
|
MD5 | d0154ca5c35f433a37d0d4d0f4680f0c |
|
BLAKE2b-256 | 154b7f47b7824dfe9c2e4dcd64ebd53f54ac408ce5ced34fbff37d79d0b8ea2a |
File details
Details for the file nextline_rdb-0.6.10-py3-none-any.whl
.
File metadata
- Download URL: nextline_rdb-0.6.10-py3-none-any.whl
- Upload date:
- Size: 189.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1125e7f4d0c480480b42822b1343128f8870297e4fd5e50727f43ea7cda16cd |
|
MD5 | 286a30660724bb6cc2907935bb357f43 |
|
BLAKE2b-256 | beab73e18becceed75230a6c86b89dcb2a32f056d77624d79c107f18df813502 |