Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes based on user feedback and real-world usage #10

Merged
merged 8 commits into from
Jun 22, 2023
Merged

Conversation

jkeifer
Copy link
Member

@jkeifer jkeifer commented Jun 21, 2023

  • Get schema version from max migration version, rather than having to declare and update table in schema.sql
  • New commands to list fixtures and to load a fixture
  • Factor out a new execute_sql method on the DB class to allow execution of arbitrary sql without having to make a SqlFile instance
  • Use __main__.main() as the entry point for CLI testing to ensure that file is tested

@jkeifer jkeifer requested a review from geomatician June 21, 2023 17:22
@jkeifer jkeifer self-assigned this Jun 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Patch coverage: 98.52% and project coverage change: +0.96 🎉

Comparison is base (7f983f3) 96.56% compared to head (1dd237b) 97.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   96.56%   97.53%   +0.96%     
==========================================
  Files           8        8              
  Lines         612      649      +37     
==========================================
+ Hits          591      633      +42     
+ Misses         21       16       -5     
Impacted Files Coverage Δ
src/dbami/cli.py 97.01% <96.87%> (+0.32%) ⬆️
src/dbami/db.py 98.69% <100.00%> (-0.31%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jkeifer jkeifer force-pushed the jak/updates branch 2 times, most recently from 97256a4 to 7ce59ed Compare June 21, 2023 22:15
jkeifer added 5 commits June 21, 2023 16:20
Rather than requiring the user to create and update the schema version
table in their schema.sql, that table will be automatically handled by
dbami when loading the schema similar to how it is for migrations. The
schema version value is now populated via the max migration version,
and means we absolutely require a starting migration now, so the 0
migration is created by `init`.

These changes also clean up handling of a rollback attempt of the base
migration by explicitly highlighting that it isn't supported.
@jkeifer jkeifer merged commit 86eaf10 into main Jun 22, 2023
@jkeifer jkeifer deleted the jak/updates branch June 22, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants