Skip to content

Commit

Permalink
add compile test
Browse files Browse the repository at this point in the history
  • Loading branch information
Justice4Joffrey committed May 1, 2022
1 parent f1b29e1 commit 7a951e4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diesel_compile_tests/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extern crate diesel;

use diesel::prelude::*;

table! {
users {
id -> Integer,
name -> Binary,
}
}

fn main() {
use self::users::dsl::*;

let mut connection = SqliteConnection::establish("").unwrap();

users
.select(name.concat(b"foo".to_vec()))
.filter(name.like(b"bar".to_vec()))
.filter(name.not_like(b"baz".to_vec()))
.get_result::<Vec<u8>>(&mut connection).unwrap();

let mut connection = MysqlConnection::establish("").unwrap();

users
.select(name.concat(b"foo".to_vec()))
.filter(name.like(b"bar".to_vec()))
.filter(name.not_like(b"baz".to_vec()))
.get_result::<Vec<u8>>(&mut connection).unwrap();
}

0 comments on commit 7a951e4

Please sign in to comment.