Skip to content

Improve model guide#515

Open
ElijahAhianyo wants to merge 16 commits into
masterfrom
elijah/model-docs-improve
Open

Improve model guide#515
ElijahAhianyo wants to merge 16 commits into
masterfrom
elijah/model-docs-improve

Conversation

@ElijahAhianyo
Copy link
Copy Markdown
Contributor

@ElijahAhianyo ElijahAhianyo commented Mar 20, 2026

Restructure the Docs, starting with the model docs. I've improved the docs to mention a large number of features/functionalities we support. I've also split the docs to span across multiple pages in a subcategory, making it easier and nicer to follow. Currently, we have 2 pages (overview and queries) for Models. The overview section is a bit nuanced as it makes mention of the CotORM, setting up models, and configuring them.

There's also a section of Relationships which I believe deserves its own page once we have the M2M feature implemented(or we can still put this in its own page and show how to do this using an intermediate through Model).

I would like to add another page for migrations, however, I'm keeping this PR ready at all times for review. Subsequent additions may or may not be included to this PR depending on when this gets merged

Related issue or discussion

Description

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

Checklist

  • I've read the contributing guide
  • Tests pass locally (just test-all)
  • Code passes clippy (just clippy)
  • Code is properly formatted (cargo fmt)
  • New tests added (regression test for bugs, coverage for new features)
  • Documentation (both code and site) updated (if applicable)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 20, 2026

🐰 Bencher Report

Branchelijah/model-docs-improve
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
5,618.50 µs
(-8.18%)Baseline: 6,118.81 µs
7,662.80 µs
(73.32%)
json_api/json_api📈 view plot
🚷 view threshold
979.24 µs
(-9.11%)Baseline: 1,077.34 µs
1,318.23 µs
(74.28%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
916.89 µs
(-7.79%)Baseline: 994.40 µs
1,200.43 µs
(76.38%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
885.76 µs
(-7.43%)Baseline: 956.85 µs
1,163.46 µs
(76.13%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
15,607.00 µs
(-11.88%)Baseline: 17,711.61 µs
21,188.15 µs
(73.66%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
rust 90.09% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added the A-docs Area: Documentation label Mar 31, 2026
@ElijahAhianyo
Copy link
Copy Markdown
Contributor Author

ElijahAhianyo commented Mar 31, 2026

depends on cot-rs/cot-site#82 and cot-rs/cot-site#84

@ElijahAhianyo
Copy link
Copy Markdown
Contributor Author

Screenshot 2026-04-02 at 3 51 59 PM


```

## Summary
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Some pages have a Summary section while others don't. I'm not too sure which direction we'd want to go, but for the sake of consistency, do we require every page to have a Summary section? I, personally, am not a big fan, but I'm also indifferent if we have them or not

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.

I'm also indifferent if we have them or not, I'd just push on being consistent and having them everywhere or nowhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, I'm leaning towards removing them, but I'm curious if @m4tx is fine with that or has a strong opinion against it

@ElijahAhianyo ElijahAhianyo marked this pull request as ready for review April 9, 2026 17:19
@ElijahAhianyo ElijahAhianyo changed the title [WIP]Improve model guide Improve model guide Apr 9, 2026
Copy link
Copy Markdown
Member

@m4tx m4tx left a comment

Choose a reason for hiding this comment

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

Amazing stuff! There are some issues here and there - please make the changes before we can merge this.

Also, sometimes you put an additional newline after section headers, sometimes you do not - please make this consistent with the rest of the guides.

#[derive(Debug, Clone)]
struct NewType(i32);

impl FromDbValue for NewType {
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.

I'm not exactly happy with how closely tied this is to the specific database backend one can use. I would expect this to be changed in the future when we'll finally land the ORM refactor.

I think it's fine to keep it as-is because there's not much we can do about this for now, but just adding this as a general comment.

Comment thread docs/databases/overview.md
Comment thread docs/databases/overview.md Outdated
Comment thread docs/databases/overview.md
Comment thread docs/databases/queries.md Outdated
Comment thread docs/databases/queries.md Outdated
Comment thread docs/databases/overview.md Outdated
Comment thread docs/databases/overview.md Outdated
Comment thread docs/databases/overview.md Outdated
Comment thread docs/databases/overview.md Outdated
Comment thread docs/databases/overview.md Outdated
Comment thread docs/databases/queries.md Outdated
Comment thread docs/databases/queries.md Outdated
Comment thread docs/databases/queries.md Outdated
Comment thread docs/databases/queries.md Outdated
Comment thread docs/databases/queries.md
@github-actions github-actions Bot added the C-macros Crate: cot-macros label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation C-macros Crate: cot-macros

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants