Skip to content
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

Put off Issue 88 #95

Merged
merged 2 commits into from
Jul 15, 2024
Merged
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
11 changes: 6 additions & 5 deletions src/database/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -527,10 +527,11 @@ impl Pool for PostgresPool {
Ok(foreign_keys)
}

async fn get_definition(&self, database: &Database, table: &Table) -> anyhow::Result<String> {
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::<String, usize>(1))
async fn get_definition(&self, _database: &Database, _table: &Table) -> anyhow::Result<String> {
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) {
Expand Down
Loading