-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement regex filtering #2515
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6fb7adf
implement regex filtering
KeenS 0b6fee4
use absolute path for backward compatibility
KeenS 929cd3e
implement for CLI
KeenS 5f2fd92
compile pass
KeenS 93c2a4a
cargo fmt
TaKO8Ki 20423a6
fix typo
KeenS b84dd04
show user friendly message
KeenS 8c36e36
remove old flags and rename -regexes flags
KeenS 8b5e375
cargo fmt
TaKO8Ki 6f9f3ea
update changelog
KeenS 1e7e3dc
update test
KeenS af8c2c8
cleanup flags
KeenS 6a92fa4
fix typo
TaKO8Ki ecda5cc
cargo fmt
TaKO8Ki 35f176d
remove closure
TaKO8Ki 49d52d6
remove `OnlyTables` and `ExceptTables`
TaKO8Ki 462582a
fix enum variants name
TaKO8Ki bcd2290
change `filter_regex` to `filter`
TaKO8Ki 3065e77
remove `whitelist`
TaKO8Ki 6f3fe60
remove `blacklist`
TaKO8Ki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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_except_table_regexes/diesel.toml
This file contains hidden or 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" | ||
| with_docs = true | ||
| filter = { except_tables = [".*1"] } |
15 changes: 15 additions & 0 deletions
15
diesel_cli/tests/print_schema/print_schema_except_table_regexes/mysql/expected.rs
This file contains hidden or 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,15 @@ | ||
| // @generated automatically by Diesel CLI. | ||
|
|
||
| diesel::table! { | ||
| /// Representation of the `users2` table. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| users2 (id) { | ||
| /// The `id` column of the `users2` table. | ||
| /// | ||
| /// Its SQL type is `Integer`. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| id -> Integer, | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_except_table_regexes/mysql/schema.sql
This file contains hidden or 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,2 @@ | ||
| CREATE TABLE users1 (id INTEGER PRIMARY KEY); | ||
| CREATE TABLE users2 (id INTEGER PRIMARY KEY); |
15 changes: 15 additions & 0 deletions
15
diesel_cli/tests/print_schema/print_schema_except_table_regexes/postgres/expected.rs
This file contains hidden or 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,15 @@ | ||
| // @generated automatically by Diesel CLI. | ||
|
|
||
| diesel::table! { | ||
| /// Representation of the `users2` table. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| users2 (id) { | ||
| /// The `id` column of the `users2` table. | ||
| /// | ||
| /// Its SQL type is `Int4`. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| id -> Int4, | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_except_table_regexes/postgres/schema.sql
This file contains hidden or 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,2 @@ | ||
| CREATE TABLE users1 (id SERIAL PRIMARY KEY); | ||
| CREATE TABLE users2 (id SERIAL PRIMARY KEY); |
15 changes: 15 additions & 0 deletions
15
diesel_cli/tests/print_schema/print_schema_except_table_regexes/sqlite/expected.rs
This file contains hidden or 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,15 @@ | ||
| // @generated automatically by Diesel CLI. | ||
|
|
||
| diesel::table! { | ||
| /// Representation of the `users2` table. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| users2 (id) { | ||
| /// The `id` column of the `users2` table. | ||
| /// | ||
| /// Its SQL type is `Nullable<Integer>`. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| id -> Nullable<Integer>, | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_except_table_regexes/sqlite/schema.sql
This file contains hidden or 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,2 @@ | ||
| CREATE TABLE users1 (id INTEGER PRIMARY KEY); | ||
| CREATE TABLE users2 (id INTEGER PRIMARY KEY); |
4 changes: 4 additions & 0 deletions
4
diesel_cli/tests/print_schema/print_schema_only_table_regexes/diesel.toml
This file contains hidden or 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" | ||
| with_docs = true | ||
| filter = { only_tables = [".*1"] } |
15 changes: 15 additions & 0 deletions
15
diesel_cli/tests/print_schema/print_schema_only_table_regexes/mysql/expected.rs
This file contains hidden or 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,15 @@ | ||
| // @generated automatically by Diesel CLI. | ||
|
|
||
| diesel::table! { | ||
| /// Representation of the `users1` table. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| users1 (id) { | ||
| /// The `id` column of the `users1` table. | ||
| /// | ||
| /// Its SQL type is `Integer`. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| id -> Integer, | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_only_table_regexes/mysql/schema.sql
This file contains hidden or 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,2 @@ | ||
| CREATE TABLE users1 (id INTEGER PRIMARY KEY); | ||
| CREATE TABLE users2 (id INTEGER PRIMARY KEY); |
15 changes: 15 additions & 0 deletions
15
diesel_cli/tests/print_schema/print_schema_only_table_regexes/postgres/expected.rs
This file contains hidden or 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,15 @@ | ||
| // @generated automatically by Diesel CLI. | ||
|
|
||
| diesel::table! { | ||
| /// Representation of the `users1` table. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| users1 (id) { | ||
| /// The `id` column of the `users1` table. | ||
| /// | ||
| /// Its SQL type is `Int4`. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| id -> Int4, | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_only_table_regexes/postgres/schema.sql
This file contains hidden or 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,2 @@ | ||
| CREATE TABLE users1 (id SERIAL PRIMARY KEY); | ||
| CREATE TABLE users2 (id SERIAL PRIMARY KEY); |
15 changes: 15 additions & 0 deletions
15
diesel_cli/tests/print_schema/print_schema_only_table_regexes/sqlite/expected.rs
This file contains hidden or 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,15 @@ | ||
| // @generated automatically by Diesel CLI. | ||
|
|
||
| diesel::table! { | ||
| /// Representation of the `users1` table. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| users1 (id) { | ||
| /// The `id` column of the `users1` table. | ||
| /// | ||
| /// Its SQL type is `Nullable<Integer>`. | ||
| /// | ||
| /// (Automatically generated by Diesel.) | ||
| id -> Nullable<Integer>, | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_only_table_regexes/sqlite/schema.sql
This file contains hidden or 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,2 @@ | ||
| CREATE TABLE users1 (id INTEGER PRIMARY KEY); | ||
| CREATE TABLE users2 (id INTEGER PRIMARY KEY); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.