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
Hashes for nextline_rdb-0.6.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53fa7f6ca7d924f28dee8a5afb2615aa9ac7e0844bc416a381f780fd657cccd |
|
MD5 | caf9d3188ffdfdb0f039e82f05ccdd9a |
|
BLAKE2b-256 | 435643cb522b110347cb37a6259945a8bc630eca130a8d6040eac85a3b58cbb6 |