Skip to content

feat!: append app name to table name#257

Merged
m4tx merged 5 commits into
cot-rs:masterfrom
yk23:table_prefix
Apr 3, 2025
Merged

feat!: append app name to table name#257
m4tx merged 5 commits into
cot-rs:masterfrom
yk23:table_prefix

Conversation

@yk23

@yk23 yk23 commented Mar 27, 2025

Copy link
Copy Markdown
Contributor

Address issue #153

Append app (crate) name to table as a prefix.

yk23 added 2 commits March 27, 2025 17:50
…d from CARGO_PKG_NAME.

* updated cot-cli to add the crate name to the table prefix in migration files (directly encoded into ModelInSource struct in the loop that parses .rs migration files)
* updated database names in unit tests (cot/tests/db.rs, cot-cli/tests, etc.) as well as test migration files to adhere to this format.
@github-actions github-actions Bot added C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) C-macros Crate: cot-macros labels Mar 27, 2025
@codecov

codecov Bot commented Mar 27, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot-cli/src/migration_generator.rs 77.77% 1 Missing and 1 partial ⚠️
Flag Coverage Δ
rust 81.58% <90.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot-macros/src/model.rs 93.89% <100.00%> (+0.50%) ⬆️
cot/src/db.rs 72.54% <ø> (ø)
cot-cli/src/migration_generator.rs 88.76% <77.77%> (+0.05%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m4tx m4tx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good change! There are a few minor issues—after fixing them this should be ready to be merged.

Comment thread cot-macros/src/model.rs Outdated
Comment thread cot-cli/src/migration_generator.rs Outdated
Comment thread examples/todo-list/src/migrations/m_0001_initial.rs Outdated
@m4tx m4tx changed the title Table prefix feat!: append app name to table name Mar 30, 2025
…ion make`.

* Added snake-case conversion code to the migration-side code.
* Replaced `unwrap()` when failing to extract CARGO_PKG_NAME env var, with `expect()` call + helpful failure message.
@yk23

yk23 commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

The new commit should address the issues @m4tx brought up. Thanks for the review.

@m4tx m4tx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good, thanks a lot for the contribution!

I'll merge this soon.

@m4tx
m4tx merged commit 1bea82e into cot-rs:master Apr 3, 2025
@cotbot cotbot Bot mentioned this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) C-macros Crate: cot-macros

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants