moonstream db
Setting up moonstreamdb
Copy sample.env to a new file and set the environment variables to appropriate values. This new file
should be sourced every time you want to access the database with the moonstreamdb application or any
dependents.
To be able to run migrations, copy alembic.sample.ini to a separate file
(e.g. ./secrets/alembic.dev.ini) and modify the sqlalchemy.url setting in the new file to point
at your database.
Make sure your database is at the latest alembic migration:
alembic -c ./secrets/alembic.dev.ini upgrade head
Adding a new table to database
Add SQLAlchemy model in moonstreamdb/models.py
Import new model and add tablename to whitelist in alembic/env.py
Create a migration:
alembic -c <alembic config file> revision -m "<revision message>" --autogenerate
Always check the autogenerated file to make sure that it isn't performing any actions that you don't want it to. A good policy is to delete any operations that don't touch the tables that you created.
Then run the migration:
alembic -c <alembic config file> upgrade head
Metadata
Release files for moonstreamdb 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| moonstreamdb-0.4.6.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moonstreamdb-0.4.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.2 kB
Release files / moonstreamdb-0.4.6.tar.gz
| Download URL | moonstreamdb-0.4.6.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f4b09926206ca59a5b4edd2a5dcb058014d505dfba4fbaa0606fb45c582639c
|
|
BLAKE2b-256 checksum How to use checksums |
718ad267348cdd75fbd43f0f6023a5186db92fab608aa44c2c8b53bcefb14c0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.8.18
|
Release files / moonstreamdb-0.4.6-py3-none-any.whl
| Download URL | moonstreamdb-0.4.6-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c23824ff7553a99200fa0dc4eae41103fbf8b8e84bcb67d1de21d3e628f146d
|
|
BLAKE2b-256 checksum How to use checksums |
6d0f9d8dd2ec8ca9e2a9759313a572fa8cd41bba872568e840f28fb47ab79b5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.8.18
|