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

Bytea, HStore and JSONB columns? #275

Closed
lephyrius opened this issue Apr 16, 2016 · 5 comments
Closed

Bytea, HStore and JSONB columns? #275

lephyrius opened this issue Apr 16, 2016 · 5 comments

Comments

@lephyrius
Copy link

I'm using Rust Nightly so that I could us the diesel codegen. Problem is that I get:

<diesel macros>:36:1: 36:47 note: in this expansion of column! (defined in <diesel macros>)
<diesel macros>:15:1: 17:58 note: in this expansion of table_body! (defined in <diesel macros>)
<diesel macros>:5:1: 6:2 note: in this expansion of table! (defined in <diesel macros>)
<diesel macros>:2:1: 2:64 note: in this expansion of table! (defined in <diesel macros>)
src/schema.rs:2:1: 2:40 note: in this expansion of table! (defined in <diesel macros>)
src/lib.rs:11:1: 11:23 note: in this expansion of include!
src/lib.rs:1:1: 1:1 help: run `rustc --explain E0412` to see a detailed explanation
src/lib.rs:1:1: 1:1 help: no candidates by the name of `Bytea` found in your project; maybe you misspelled the name or forgot to import an external crate?
src/lib.rs:1:1: 1:1 error: type name `Bytea` is undefined or not in scope [E0412]
src/lib.rs:1 #![cfg_attr(feature = "nightly", feature(custom_derive, custom_attribute, plugin))]

<diesel macros>:15:1: 17:58 note: in this expansion of table_body! (defined in <diesel macros>)
<diesel macros>:5:1: 6:2 note: in this expansion of table! (defined in <diesel macros>)
<diesel macros>:2:1: 2:64 note: in this expansion of table! (defined in <diesel macros>)
src/schema.rs:2:1: 2:40 note: in this expansion of table! (defined in <diesel macros>)
src/lib.rs:11:1: 11:23 note: in this expansion of include!
src/lib.rs:1:1: 1:1 help: run `rustc --explain E0412` to see a detailed explanation
src/lib.rs:1:1: 1:1 help: no candidates by the name of `Hstore` found in your project; maybe you misspelled the name or forgot to import an external crate?
src/lib.rs:1:1: 1:1 error: type name `Hstore` is undefined or not in scope [E0412]
src/lib.rs:1 #![cfg_attr(feature = "nightly", feature(custom_derive, custom_attribute, plugin))]
             ^
<diesel macros>:36:1: 36:47 note: in this expansion of column! (defined in <diesel macros>)
<diesel macros>:15:1: 17:58 note: in this expansion of table_body! (defined in <diesel macros>)
<diesel macros>:5:1: 6:2 note: in this expansion of table! (defined in <diesel macros>)
<diesel macros>:2:1: 2:64 note: in this expansion of table! (defined in <diesel macros>)
src/schema.rs:2:1: 2:40 note: in this expansion of table! (defined in <diesel macros>)
src/lib.rs:11:1: 11:23 note: in this expansion of include!
src/lib.rs:1:1: 1:1 help: run `rustc --explain E0412` to see a detailed explanation
src/lib.rs:1:1: 1:1 help: no candidates by the name of `Hstore` found in your project; maybe you misspelled the name or forgot to import an external crate?
src/lib.rs:1:1: 1:1 error: type name `Jsonb` is undefined or not in scope [E0412]
src/lib.rs:1 #![cfg_attr(feature = "nightly", feature(custom_derive, custom_attribute, plugin))]
             ^
<diesel macros>:15:1: 17:58 note: in this expansion of table_body! (defined in <diesel macros>)
<diesel macros>:5:1: 6:2 note: in this expansion of table! (defined in <diesel macros>)
<diesel macros>:2:1: 2:64 note: in this expansion of table! (defined in <diesel macros>)
src/schema.rs:2:1: 2:40 note: in this expansion of table! (defined in <diesel macros>)
src/lib.rs:11:1: 11:23 note: in this expansion of include!
src/lib.rs:1:1: 1:1 help: run `rustc --explain E0412` to see a detailed explanation
src/lib.rs:1:1: 1:1 help: no candidates by the name of `Jsonb` found in your project; maybe you misspelled the name or forgot to import an external crate?
src/lib.rs:1:1: 1:1 error: type name `Jsonb` is undefined or not in scope [E0412]
src/lib.rs:1 #![cfg_attr(feature = "nightly", feature(custom_derive, custom_attribute, plugin))]
             ^

Is there a way to just "ignore" those columns?

@sgrif
Copy link
Member

sgrif commented Apr 16, 2016

Bytea should be working fine in 0.6.1.

To answer your more general question, there's no way to ignore them, but you can call the table! macro directly for those tables, and then call infer_table_from_schema! for the rest of the tables, instead of infer_schema!

@sgrif
Copy link
Member

sgrif commented Apr 16, 2016

Closing this as there's nothing actionable. If this didn't sufficiently answer your question, feel free to ping me here or in gitter (and if Bytea isn't working in 0.6.1 that is definitely a bug)

@sgrif sgrif closed this as completed Apr 16, 2016
@sgrif
Copy link
Member

sgrif commented Apr 20, 2016

Were you ever able to confirm that at least Bytea was working correctly for you?

@lephyrius
Copy link
Author

@sgrif it works!
Still missing JSONB and HSTORE :(

@sgrif
Copy link
Member

sgrif commented Apr 20, 2016

👍 Yeah, need to add support for those types (will likely be a separate crate actually). Still unresolved questions, but if you're interested in working on it let me know and I'd be happy to help. Tracking issue: #44

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

No branches or pull requests

2 participants