Skip to content

Commit 3b1dbf5

Browse files
committed
test: change "custom_model_and_schema_path" to be compile-able
1 parent a8db133 commit 3b1dbf5

File tree

11 files changed

+36
-4
lines changed

11 files changed

+36
-4
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ members = [
5050
"test/simple_table_pg",
5151
"test/simple_table_mysql",
5252
"test/simple_table_sqlite",
53+
"test/custom_model_and_schema_path",
5354
]
5455
resolver = "2"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[lib]
2+
path = "lib.rs"
3+
4+
[package]
5+
name = "custom_model_and_schema_path"
6+
version = "0.1.0"
7+
edition = "2021"
8+
9+
[dependencies]
10+
diesel = { version = "*", default-features = false, features = [
11+
"postgres",
12+
"chrono",
13+
] }
14+
dsync = { path = "../../" }
15+
chrono = { version = "*", features = ["serde"] }
16+
serde = { version = "*", features = ["derive"] }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod models;
2+
pub mod schema;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pub mod table_a;
2-
pub mod table_b;
2+
pub mod table_b;

test/custom_model_and_schema_path/models/table_a/generated.rs renamed to test/custom_model_and_schema_path/data/models/table_a/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use diesel::*;
44
use crate::data::schema::*;
55
use diesel::QueryResult;
66

7-
pub type ConnectionType = diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::prelude::PgConnection>>;
7+
pub type ConnectionType = diesel::prelude::PgConnection;
88

99
/// Struct representing a row in table `tableA`
1010
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Queryable, Selectable)]

test/custom_model_and_schema_path/models/table_b/generated.rs renamed to test/custom_model_and_schema_path/data/models/table_b/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::data::models::table_a::TableA;
55
use crate::data::schema::*;
66
use diesel::QueryResult;
77

8-
pub type ConnectionType = diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::prelude::PgConnection>>;
8+
pub type ConnectionType = diesel::prelude::PgConnection;
99

1010
/// Struct representing a row in table `tableB`
1111
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Queryable, Selectable, Associations, Identifiable)]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#![allow(non_snake_case)]
2+
pub mod data;

0 commit comments

Comments
 (0)