Closed lexicalunit closed 4 years ago
"3,000"
whereas before they were listed as just integers.data
is the stuff stored in the databaseassets
is the static application asset datatest/fixtures
is the static test fixture data.csv
files just in case.db_dir
path as that could mess up migrations if people actually used it.rockin
now and it knows that you mean Rockin' K.K.
!rollback
but that's future work.In the future we could now allow people to provide a database configuration and let them select the database they want to use. In development/tests we could use a sqlite database. Then in CI we could have a matrix that tests against sqlite and postgres. And in production people could optionally run against postgres. We'd need to have something like postgres in the future if we wanted to support multiple servers.
We might also want to re-visit how we're using data.commit()
in the future as wholesale overwriting the table data isn't what we want to have happen. Maybe pandas is smart enough not to be doing that 🤷♀️ In any case, we can probably refactor some of the commands at some point in the future to do things more optimally.
Edit: Fixed this!
Updated PR to add Alembic database migrations so that we can easy migrate database over time.
I also added the first migration beyond the initial revision to add relationships to our data models. This could be super helpful in the future in refactoring things to be really nice. For example with relationship we can do things like:
user = get_user()
user.prices # get all this user's prices thru the relationship
user.fossils # get all this user's fossils thru the relationship
etc...
Merging #171 into master will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #171 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 2 4 +2
Lines 109 214 +105
Branches 13 12 -1
==========================================
+ Hits 109 214 +105
Impacted Files | Coverage Δ | |
---|---|---|
src/turbot/assets.py | 100.00% <100.00%> (ø) |
|
src/turbot/data.py | 100.00% <100.00%> (ø) |
|
...rsions/versions/1afdca2a2389_adds_relationships.py | 100.00% <100.00%> (ø) |
|
...versions/versions/cb8aa87d74cb_initial_revision.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 8e50568...3b13fc0. Read the comment docs.
Also added docker documentation and fixed up some issues with #154.
Added support for TURBOT_DB_URL
so that we can theoretically use any database we want now.
It's ready!
TODO: