-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sabati
committed
Apr 24, 2024
1 parent
9eda267
commit 1ff4ad9
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
diesel_cli/tests/print_schema/print_schema_skip_missing_sql_type_definitions/diesel.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[print_schema] | ||
file = "src/schema.rs" | ||
generate_missing_sql_type_definitions = true | ||
skip_missing_sql_type_definitions = ["MyType2"] |
23 changes: 23 additions & 0 deletions
23
.../tests/print_schema/print_schema_skip_missing_sql_type_definitions/postgres/expected.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: diesel_cli/tests/print_schema.rs | ||
description: "Test: print_schema_custom_types_check_default_derives" | ||
--- | ||
// @generated automatically by Diesel CLI. | ||
|
||
pub mod sql_types { | ||
#[derive(diesel::sql_types::SqlType)] | ||
#[diesel(postgres_type(name = "my_type"))] | ||
pub struct MyType; | ||
} | ||
|
||
diesel::table! { | ||
use diesel::sql_types::*; | ||
use super::sql_types::MyType; | ||
|
||
custom_types (id) { | ||
id -> Int4, | ||
custom_enum -> MyType, | ||
custom_enum_nullable -> Nullable<MyType>, | ||
custom_enum2 -> MyType2, | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...cli/tests/print_schema/print_schema_skip_missing_sql_type_definitions/postgres/schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TYPE my_type AS ENUM ('foo', 'bar'); | ||
CREATE TYPE my_type2 AS ENUM ('foo', 'bar'); | ||
CREATE TABLE custom_types ( | ||
id SERIAL PRIMARY KEY, | ||
custom_enum my_type NOT NULL, | ||
custom_enum_nullable my_type, | ||
custom_enum2 my_type2 NOT NULL | ||
); |