AnswerDotAI / AnswerDotAI/fastmigrate
Document use of fastmigrate with fastlite
- Dominant language
- Python
- Stars
- 36
- Forks
- 0
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Something like this:
```python
from fastlite import *
from fastmigrate import *
def get_db():
# Determine db path
if IN_NOTEBOOK or os.getenv("IN_TEST"):
dbpath = datapath/'dev_data.db'
for o in '','-shm','-wal': (datapath/f'dev_data.db{o}').unlink(missing_ok=True)
else: dbpath = datapath/'data.db'
migrations_dir = '??'
# fastmigrate: Ensure the db is versioned
ensure_versioned_db(dbpath)
# fastmigrate: run migrations
run_migrations(dbpath, migrations_dir)
# fastlight: instantiate db path
db = database(dbpath)
return db
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.