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

Support fake data #57

Merged
merged 1 commit into from
Mar 5, 2023
Merged

Support fake data #57

merged 1 commit into from
Mar 5, 2023

Conversation

jayvdb
Copy link
Collaborator

@jayvdb jayvdb commented Mar 1, 2023

No description provided.

@jayvdb jayvdb changed the title WIP: Support fake data Support fake data Mar 1, 2023
@@ -199,3 +202,11 @@ where
Ok(Self::from_pk(T::PKType::deserialize(deserializer)?))
}
}

#[cfg(feature = "fake")]
/// Fake data support is currently limited to empty ForeignKey relationships.
Copy link
Owner

Choose a reason for hiding this comment

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

When would this actually be useful? Since this creates an invalid ForeignKey (not fully initialized) and most of the methods will panic if called

Copy link
Owner

Choose a reason for hiding this comment

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

I guess the idea is that none of the methods would get called since you wouldn't use it with a real db connection given that it's fake data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ya, at the moment the ForeignKey, and Many, are not well supported, and the user needs to know what they are doing to manually help the fake-ing process like I did in the fake test cases. Goal is for that to be automatic eventually, but at the moment this PR allows butane and fake to co-exist on the same data structures.

@Electron100 Electron100 merged commit 9eff993 into Electron100:master Mar 5, 2023
@jayvdb jayvdb deleted the allow-fake branch June 14, 2023 06:36
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