Skip to main content

Moonstream database

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moonstreamdb-0.4.6.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moonstreamdb-0.4.6-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file moonstreamdb-0.4.6.tar.gz.

File metadata

  • Download URL: moonstreamdb-0.4.6.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.18

File hashes

Hashes for moonstreamdb-0.4.6.tar.gz
Algorithm Hash digest
SHA256 6f4b09926206ca59a5b4edd2a5dcb058014d505dfba4fbaa0606fb45c582639c
MD5 3ed8cbef70c887cdd9b1a44c391da296
BLAKE2b-256 718ad267348cdd75fbd43f0f6023a5186db92fab608aa44c2c8b53bcefb14c0a

See more details on using hashes here.

File details

Details for the file moonstreamdb-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: moonstreamdb-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.18

File hashes

Hashes for moonstreamdb-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8c23824ff7553a99200fa0dc4eae41103fbf8b8e84bcb67d1de21d3e628f146d
MD5 d8cd5899468017d358f6e99703c16f07
BLAKE2b-256 6d0f9d8dd2ec8ca9e2a9759313a572fa8cd41bba872568e840f28fb47ab79b5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page