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

infer_table_from_schema! panics when that table is in a non-default schema #646

Closed
jasonl opened this Issue Feb 8, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@jasonl

jasonl commented Feb 8, 2017

Using version 0.10.0:

error: proc-macro derive panicked
 --> src/models/mrr_interval.rs:8:1
  |
8 | infer_table_from_schema!("dotenv:PG_URL", "snowflake.mrr_intervals");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: message: Postgres TableDate has schema
  = note: this error originates in a macro outside of the current crate

The panic comes from:

https://github.com/diesel-rs/diesel/blob/v0.10.0/diesel_infer_schema/src/pg.rs#L131

Which is because (as far as I can see), TableData.schema can only ever be None as set at:

https://github.com/diesel-rs/diesel/blob/v0.10.0/diesel_codegen/src/schema_inference.rs#L58

A brief look at master seems to suggest this might already be fixed, but I'll raise this issue anyway so that the developers are aware of it.

This is being built on a recent nightly, but I'm not sure that's relevant.

ubuntu@snowflake:/vagrant$ rustc --version
rustc 1.17.0-nightly (c49d10207 2017-02-07)
@sgrif

This comment has been minimized.

Member

sgrif commented Feb 8, 2017

Yes, this has been fixed on master. It's a serious enough bug to warrant a new release. I will cherry-pick it and release a bugfix release with it.

@sgrif

This comment has been minimized.

Member

sgrif commented Feb 8, 2017

I've released v0.10.1 which includes a fix for this issue. For posterity, this was fixed by e0272a4

@sgrif sgrif closed this Feb 8, 2017

@jasonl

This comment has been minimized.

jasonl commented Feb 9, 2017

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment