From 4796b7f14d2a62347d801849e6818aea7f42cc7d Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Mon, 15 Jul 2024 22:17:14 +0900 Subject: [PATCH 1/2] fix count rows in postgres --- src/database/postgres.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/postgres.rs b/src/database/postgres.rs index d1afca0..d693ae4 100644 --- a/src/database/postgres.rs +++ b/src/database/postgres.rs @@ -368,7 +368,7 @@ impl Pool for PostgresPool { ) } else { format!( - r#"SELECT COUNT(*) FROM "{database}"."{table_schema}"."{table}"#, + r#"SELECT COUNT(*) FROM "{database}"."{table_schema}"."{table}""#, database = database.name, table = table.name, table_schema = table.schema.clone().unwrap_or_else(|| "public".to_string()), From 53d79d55cbcb91f94bd9ee51c3eadd5160c5a101 Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Mon, 15 Jul 2024 22:37:19 +0900 Subject: [PATCH 2/2] Put off fixing --- src/database/postgres.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/database/postgres.rs b/src/database/postgres.rs index d693ae4..ae59a3f 100644 --- a/src/database/postgres.rs +++ b/src/database/postgres.rs @@ -527,10 +527,11 @@ impl Pool for PostgresPool { Ok(foreign_keys) } - async fn get_definition(&self, database: &Database, table: &Table) -> anyhow::Result { - let query = format!("SHOW CREATE TABLE `{}`.`{}`;", database.name, table.name); - let row = sqlx::query(query.as_str()).fetch_one(&self.pool).await?; - Ok(row.get::(1)) + async fn get_definition(&self, _database: &Database, _table: &Table) -> anyhow::Result { + Ok("Sorry, Postgres SQL is not supported Table Definitions.\n\ + Please see this issue if you want to implement this feature, see here!\n\ + https://github.com/kyoto7250/zhobo/issues/94" + .to_owned()) } async fn close(&self) {