-
-
Notifications
You must be signed in to change notification settings - Fork 461
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream Changes - 4 #2168
Merged
Merged
Upstream Changes - 4 #2168
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3857b2c
cli: generate entity ignore default database schema
billy1624 fd89854
fixup
billy1624 c115c5d
select result is `i32`
billy1624 c349217
Merge branch 'master' into upstream-changes-4
billy1624 68912a6
fix
billy1624 24f7b55
clippy
billy1624 ffce5b7
revert
billy1624 bfc4c57
revert
billy1624 cee8474
revert
billy1624 baa7207
revert
billy1624 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -818,16 +818,9 @@ impl EntityWriter { | |
} | ||
|
||
pub fn gen_schema_name(schema_name: &Option<String>) -> Option<TokenStream> { | ||
match schema_name { | ||
Some(schema_name) => { | ||
if schema_name != "public" { | ||
Some(quote! { #schema_name }) | ||
} else { | ||
None | ||
} | ||
} | ||
None => None, | ||
} | ||
Comment on lines
-821
to
-830
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then we can remove this checking at codegen. This checking should be part of CLI anyway. |
||
schema_name | ||
.as_ref() | ||
.map(|schema_name| quote! { #schema_name }) | ||
} | ||
} | ||
|
||
|
@@ -1569,27 +1562,6 @@ mod tests { | |
}) | ||
.to_string() | ||
); | ||
assert_eq!( | ||
parse_from_file(ENTITY_FILES[i].as_bytes())?.to_string(), | ||
EntityWriter::gen_expanded_code_blocks( | ||
entity, | ||
&crate::WithSerde::None, | ||
&crate::DateTimeCrate::Chrono, | ||
&Some("public".to_owned()), | ||
false, | ||
false, | ||
&TokenStream::new(), | ||
&TokenStream::new(), | ||
false, | ||
) | ||
.into_iter() | ||
.skip(1) | ||
.fold(TokenStream::new(), |mut acc, tok| { | ||
acc.extend(tok); | ||
acc | ||
}) | ||
.to_string() | ||
); | ||
assert_eq!( | ||
parse_from_file(ENTITY_FILES_WITH_SCHEMA_NAME[i].as_bytes())?.to_string(), | ||
EntityWriter::gen_expanded_code_blocks( | ||
|
@@ -1674,27 +1646,6 @@ mod tests { | |
}) | ||
.to_string() | ||
); | ||
assert_eq!( | ||
parse_from_file(ENTITY_FILES[i].as_bytes())?.to_string(), | ||
EntityWriter::gen_compact_code_blocks( | ||
entity, | ||
&crate::WithSerde::None, | ||
&crate::DateTimeCrate::Chrono, | ||
&Some("public".to_owned()), | ||
false, | ||
false, | ||
&TokenStream::new(), | ||
&TokenStream::new(), | ||
false, | ||
) | ||
.into_iter() | ||
.skip(1) | ||
.fold(TokenStream::new(), |mut acc, tok| { | ||
acc.extend(tok); | ||
acc | ||
}) | ||
.to_string() | ||
); | ||
assert_eq!( | ||
parse_from_file(ENTITY_FILES_WITH_SCHEMA_NAME[i].as_bytes())?.to_string(), | ||
EntityWriter::gen_compact_code_blocks( | ||
|
@@ -2344,27 +2295,6 @@ mod tests { | |
}) | ||
.to_string() | ||
); | ||
assert_eq!( | ||
parse_from_file(ENTITY_FILES[i].as_bytes())?.to_string(), | ||
EntityWriter::gen_compact_code_blocks( | ||
entity, | ||
&crate::WithSerde::None, | ||
&crate::DateTimeCrate::Chrono, | ||
&Some("public".to_owned()), | ||
false, | ||
false, | ||
&TokenStream::new(), | ||
&TokenStream::new(), | ||
false, | ||
) | ||
.into_iter() | ||
.skip(1) | ||
.fold(TokenStream::new(), |mut acc, tok| { | ||
acc.extend(tok); | ||
acc | ||
}) | ||
.to_string() | ||
); | ||
assert_eq!( | ||
parse_from_file(ENTITY_FILES_EXPANDED[i].as_bytes())?.to_string(), | ||
EntityWriter::gen_expanded_code_blocks( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should only pass through non-default schema here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK