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

Tables appear to be limited in number of columns #500

Closed
noyez opened this Issue Nov 23, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@noyez

noyez commented Nov 23, 2016

I am a Rust beginner, so I apologize if this is not a bug and that i missed something obvious.

rust version: rustc 1.13.0 (2c6933acc 2016-11-07)
diesel version: 0.8.0 (using getting_started_step_4 projects as template)

I attempted to use a table with 17 fields using the diesel framework and compilation fails. Compilation succeeds with 16 fields. Attached ( diesel-many-fields.tar.gz ) is a modified project based from the examples/getting_started_step_4 project. The tar file can be unpacked in the examples/ directory, and the script test_stable.large can be run compile the code.

Of Note, line 30 in src/models.rs and line 15 in migrations/20160815133237_create_posts/up.sql. if each line is commented out, the code compiles, if each line is active, code does not compile.

error[E0277]: the trait bound `(schema::posts_large::columns::f_00, schema::posts_large::columns::f_01, schema::posts_large::columns::f_02, schema::posts_large::columns::f_03, schema::posts_large::columns::f_04, schema::posts_large::columns::f_05, schema::posts_large::columns::f_06, schema::posts_large::columns::f_07, schema::posts_large::columns::f_08, schema::posts_large::columns::f_09, schema::posts_large::columns::f_10, schema::posts_large::columns::f_11, schema::posts_large::columns::f_12, schema::posts_large::columns::f_13, schema::posts_large::columns::f_14, schema::posts_large::columns::f_15, schema::posts_large::columns::f_99): diesel::SelectableExpression<schema::posts_large::table, (diesel::types::Integer, diesel::types::Text, diesel::types::Text, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Bool)>` is not satisfied
  --> src/lib.rs:12:1
   |
12 | include!(concat!(env!("OUT_DIR"), "/lib.rs"));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `(schema::posts_large::columns::f_00, schema::posts_large::columns::f_01, schema::posts_large::columns::f_02, schema::posts_large::columns::f_03, schema::posts_large::columns::f_04, schema::posts_large::columns::f_05, schema::posts_large::columns::f_06, schema::posts_large::columns::f_07, schema::posts_large::columns::f_08, schema::posts_large::columns::f_09, schema::posts_large::columns::f_10, schema::posts_large::columns::f_11, schema::posts_large::columns::f_12, schema::posts_large::columns::f_13, schema::posts_large::columns::f_14, schema::posts_large::columns::f_15, schema::posts_large::columns::f_99): diesel::SelectableExpression<schema::posts_large::table, (diesel::types::Integer, diesel::types::Text, diesel::types::Text, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Bool)>` not satisfied
   |
   = note: required because of the requirements on the impl of `diesel::query_builder::Query` for `diesel::query_builder::SelectStatement<(diesel::types::Integer, diesel::types::Text, diesel::types::Text, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Nullable<diesel::types::Text>, diesel::types::Bool), (schema::posts_large::columns::f_00, schema::posts_large::columns::f_01, schema::posts_large::columns::f_02, schema::posts_large::columns::f_03, schema::posts_large::columns::f_04, schema::posts_large::columns::f_05, schema::posts_large::columns::f_06, schema::posts_large::columns::f_07, schema::posts_large::columns::f_08, schema::posts_large::columns::f_09, schema::posts_large::columns::f_10, schema::posts_large::columns::f_11, schema::posts_large::columns::f_12, schema::posts_large::columns::f_13, schema::posts_large::columns::f_14, schema::posts_large::columns::f_15, schema::posts_large::columns::f_99), schema::posts_large::table>`
   = note: required by `diesel::query_builder::AsQuery`
   = note: this error originates in a macro outside of the current crate

@killercup

This comment has been minimized.

Member

killercup commented Nov 24, 2016

@noyez

This comment has been minimized.

noyez commented Nov 24, 2016

Thank you, this is indeed that case. I added the following to Cargo.toml, and it compiled successfully.

[dependencies]
diesel = { version = "0.8.1", features = ["large-tables"] }

@noyez noyez closed this Nov 24, 2016

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