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

Allowing sqlite unsigned #1907

Open
0xpr03 opened this Issue Nov 7, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@0xpr03

0xpr03 commented Nov 7, 2018

Versions

  • Rust: 1.29.2
  • Diesel: 1.3.3
  • Database: sqlite
  • Operating System linux

Problem Description

I can't describe unsigned integers in diesel for sqlite, although I'm trying to access an existing DB with unsigned integer. (Called integerunsigned by SQliteBrowser)

What are you trying to accomplish?

Access unsigned integers in sqlite.

Steps to reproduce

db.rs:

let connection =
            SqliteConnection::establish("mydb.db").expect("Csn't rach db");
        let result = General
            .load::<GeneralEntry>(&connection)
            .expect("Can't query db settings");

schema.rs:

table! {
    General(key) {
        key -> VarChar,
        timestamp -> Unsigned<Integer>,
        value -> VarChar,
    }
}

models.rs:

use schema::General;

#[derive(Queryable)]
pub struct GeneralEntry {
    pub timestamp: u32,
    pub key: String,
    pub value: String,
}

#[derive(Insertable)]
#[table_name = "General"]
pub struct NewGeneral<'a> {
    pub timestamp: u32,
    pub key: &'a str,
    pub value: &'a str,
}

Output rustc:

.load::<GeneralEntry>(&connection)
    |              ^^^^ the trait `diesel::sql_types::HasSqlType<diesel::sql_types::Unsigned<diesel::sql_types::Integer>>` is not implemented for `diesel::sqlite::Sqlite`

Checklist

  • I have already looked over the issue tracker for similar issues.
  • This issue can be reproduced on Rust's stable channel. (Your issue will be
    closed if this is not the case)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment