这是indexloc提供的服务,不要输入任何密码
Skip to content

Support all table types #17

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 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clickhouse_gdc"
version = "2.37.2"
version = "2.40.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## 2.40.0

- Support all table types (previously only supported BASE TABLE and VIEW)

## 2.37.2

- fix breaking change: don't use schema qualification for the `default` schema.
Expand Down
1 change: 0 additions & 1 deletion src/server/routes/introspection/basic_info_filtered.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ SELECT
tables.table_type AS "table_type"
FROM INFORMATION_SCHEMA.TABLES AS tables
WHERE tables.table_catalog NOT IN ('system', 'INFORMATION_SCHEMA', 'information_schema')
AND tables.table_type IN ('BASE TABLE', 'VIEW')
AND tables.table_name IN {table_names:Array(String)}
FORMAT JSON;
1 change: 0 additions & 1 deletion src/server/routes/introspection/basic_info_unfiltered.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ SELECT
tables.table_type AS "table_type"
FROM INFORMATION_SCHEMA.TABLES AS tables
WHERE tables.table_catalog NOT IN ('system', 'INFORMATION_SCHEMA', 'information_schema')
AND tables.table_type IN ('BASE TABLE', 'VIEW')
FORMAT JSON;
1 change: 0 additions & 1 deletion src/server/routes/introspection/everything_filtered.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ LEFT JOIN (
) AS system_columns ON system_columns.database = tables.table_schema
AND system_columns.table = tables.table_name
WHERE tables.table_catalog NOT IN ('system', 'INFORMATION_SCHEMA', 'information_schema')
AND tables.table_type IN ('BASE TABLE', 'VIEW')
AND tables.table_name IN {table_names:Array(String)}
FORMAT JSON;
3 changes: 1 addition & 2 deletions src/server/routes/introspection/everything_unfiltered.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ LEFT JOIN (
) AS system_columns ON system_columns.database = tables.table_schema
AND system_columns.table = tables.table_name
WHERE tables.table_catalog NOT IN ('system', 'INFORMATION_SCHEMA', 'information_schema')
AND tables.table_type IN ('BASE TABLE', 'VIEW')
FORMAT JSON;
FORMAT JSON;
8 changes: 6 additions & 2 deletions src/server/routes/post_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ pub async fn post_schema(

#[derive(Debug, Serialize, Deserialize)]
enum IntrospectionTableType {
#[serde(rename = "BASE TABLE")]
#[serde(
rename = "BASE TABLE",
alias = "FOREIGN TABLE",
alias = "LOCAL TEMPORARY"
)]
BaseTable,
#[serde(rename = "VIEW")]
#[serde(rename = "VIEW", alias = "SYSTEM VIEW")]
View,
}

Expand Down