Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign uperror: cannot find macro `infer_schema!` in this scope #1132
Comments
This comment has been minimized.
yyolf117
commented
Aug 27, 2017
|
with 0.16 the exception becomes this:
|
This comment has been minimized.
|
Yeah, it's a known issue that the recursion limit is reached quite quickly
by that macro. Just do what the compiler says and increase it to 128 or
more until it works :) There was another issue here with a bit more
information if you want to know more details.
(This default will actually change in rustc soon IIRC.)
yyolf117 <notifications@github.com> schrieb am So. 27. Aug. 2017 um 10:12:
… with 0.16 the exception becomes this:
error: recursion limit reached while expanding the macro `table_body`
--> src/schema.rs:1:1
|
1 | infer_schema!("dotenv:DATABASE_URL");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
= note: this error originates in a macro outside of the current crate
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOX4GkyJxC7rinI7GMGnM1vVfGmzeVks5scSTUgaJpZM4PDuu7>
.
|
This comment has been minimized.
yyolf117
commented
Aug 27, 2017
•
|
I've put #![recursion_limit="128"] to the main file of my crate - src/main.rs - but the error remained. |
This comment has been minimized.
|
Did you try a higher limit or putting it in the schema.rs file?
yyolf117 <notifications@github.com> schrieb am So. 27. Aug. 2017 um 12:38:
… I've put #![recursion_limit="128"] to my main file of my crate - main.rs
- but the error remained.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOX2-_TIyB9uxqtsVZnT2wRaYM6rWeks5scUcmgaJpZM4PDuu7>
.
|
This comment has been minimized.
yyolf117
commented
Aug 27, 2017
|
yes, yes. |
This comment has been minimized.
|
Yes, `diesel print-schema` will show you the calls to table! that
infer_schema! creates. You can copy those to the file instead of calling
infer_schema!.
yyolf117 <notifications@github.com> schrieb am So. 27. Aug. 2017 um 13:08:
… yes, yes.
is it possible to use diesel without infer_schema!("dotenv:DATABASE_URL")
by writing code manually?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOX_sjeIAB7Bz-VyFacZH1yObmdZvkks5scU4UgaJpZM4PDuu7>
.
|
This comment has been minimized.
yyolf117
commented
Aug 27, 2017
•
|
Now there're several errors:
|
This comment has been minimized.
|
Can you quote the full error? And give more details on what your schema is?
It's really hard to guess :)
yyolf117 <notifications@github.com> schrieb am So. 27. Aug. 2017 um 13:33:
… Now there're several errors:
the trait bound `(......)` is not satisfied
^ the trait `diesel::Expression` is not implemented for .....
= note: required by diesel::query_builder::AsQuery
= note: this error originates in a macro outside of the current crate
^ the trait `diesel::SelectableExpression<schema .....` is not implemented for .....
^ the trait `diesel::expression::NonAggregate` is not implemented for .....
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOX5ahdLNdyBDqKK1niZm-7JYPoLF4ks5scVQYgaJpZM4PDuu7>
.
|
This comment has been minimized.
Maybe it'll help looking at the finished code that you can download and run? You can find it here. |
This comment has been minimized.
ghost
commented
Aug 28, 2017
|
@killercup
|
This comment has been minimized.
|
See above: just do what the compiler suggests and increase the recursion
limit :)
Lisq <notifications@github.com> schrieb am Mo. 28. Aug. 2017 um 05:39:
… @killercup <https://github.com/killercup>
I got a error
error: recursion limit reached while expanding the macro `numeric_expr`
--> src/schema.rs:1:1
|
1 | infer_schema!("dotenv:DATABASE_URL");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
= note: this error originates in a macro outside of the current crate
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOX922jNiIMVwB5A1H9t5lhpD_2bX3ks5scjZbgaJpZM4PDuu7>
.
|
killercup
added
the
question
label
Aug 28, 2017
This comment has been minimized.
yyolf117
commented
Aug 28, 2017
|
I have a model with many fields:
Exceptions:
|
This comment has been minimized.
|
Ah, I see. You'll to enable the |
This comment has been minimized.
|
I assume this solved the issue for you? If you have any more questions, don't hesitate to ask here or on gitter! |
killercup
closed this
Aug 30, 2017
This comment has been minimized.
dvberkel
commented
Oct 10, 2017
•
|
I experienced the same problem while walking through the tutorial. I cranked the recursion limit up all the way to 4096 to no avail. My model is small: #[derive(Serialize, Deserialize, Debug, PartialEq, Queryable)]
pub struct Event {
id: i32,
origin: String,
message: String,
}but it doesn't residue in
Putting this in Does anyone have a clue? |
This comment has been minimized.
dvberkel
commented
Oct 10, 2017
|
I asked help on the diesel-rs/diesel and @weiznich came to the rescue. @weiznich quickly found out that I was missing a |
yyolf117 commentedAug 27, 2017
•
edited
I'm following the tutorial step by step. In "src/schema.rs" I have only this single line:
And: