Skip to content

Conversation

@Mahi-korrapati
Copy link

This PR adds a new section in the documentation under guide_drafts/best-practices.md
describing how to avoid namespace conflicts when using #[derive(Insertable)].

✅ Includes:

  • Correct example using a single table DSL (use crate::schema::users)
  • Problematic example showing conflicts with multiple DSL imports

This helps clarify one of the common pitfalls mentioned in the meta issue.

@Mahi-korrapati
Copy link
Author

Hi! 👋
I’ve added the example for #[derive(Insertable)] in the docs to clarify common pitfalls with multiple DSL imports.
All checks are running/skipped as expected for docs-only changes.
Please review when you have a moment. Thank you! 😊

@weiznich weiznich requested a review from a team October 31, 2025 17:03
@Mahi-korrapati
Copy link
Author

Hi @weiznich, @diesel-rs/core-team 👋
Just following up on this docs PR. All checks have passed and it’s ready for review whenever you have time.
Thanks for maintaining this awesome project!

@weiznich
Copy link
Member

weiznich commented Nov 5, 2025

There is no need to ping anyone here. We are aware of any PR opened to this repo, there is just not enough time to look at everything at once. By pining someone you don't make this happening faster, so please don't do that again.


On the PR itself: While I think that this information might be helpful I strongly feel that this is not the right place to add this information as not many users will actually look there. That sounds like something that would be a better fit for our webpage (as part of an existing guide, although for example the getting started guide already has a note on this:

The use self::schema::posts::dsl::* line imports a bunch of aliases so that we can say posts instead of posts::table, and published instead of posts::published. It’s useful when we’re only dealing with a single table, but that’s not always what we want. It’s always important to keep imports to schema::table::dsl::* inside of the current function to prevent polluting the module namespace.

@Mahi-korrapati
Copy link
Author

Thanks for the review. The note has been moved to the documentation as suggested

@Mahi-korrapati
Copy link
Author

Hi, I’ve updated the branch and moved the note to the documentation as suggested.
All checks are passing now — this is ready for review. Thank you! 🙏

@weiznich
Copy link
Member

This didn't change at all. So either you did not push your changes or they got lost somehow.

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.

2 participants