Skip to content

Commit 66ca52a

Browse files
authored
fix(databases): rename --description to --name in databases run (#122)
Align `databases run` with `databases create`, which already uses --name for the catalog alias of the auto-created database. Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
1 parent 630c591 commit 66ca52a

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@ pub enum DatabasesCommands {
639639
#[arg(long)]
640640
database: Option<String>,
641641

642-
/// Description for the auto-created database (only used when --database is omitted)
642+
/// Name for the auto-created database (only used when --database is omitted)
643643
#[arg(long)]
644-
description: Option<String>,
644+
name: Option<String>,
645645

646646
/// Schema for tables declared in the auto-created database (default: public)
647647
#[arg(long, default_value = "public")]

src/databases.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,13 @@ pub fn get(workspace_id: &str, id_or_name: &str, format: &str) {
453453
/// the id instead of printing.
454454
fn create_and_return_id(
455455
api: &ApiClient,
456-
description: Option<&str>,
456+
name: Option<&str>,
457457
schema: &str,
458458
tables: &[String],
459459
expires_at: Option<&str>,
460460
) -> String {
461461
use crossterm::style::Stylize;
462-
let body = create_database_request(description, schema, tables, expires_at);
462+
let body = create_database_request(name, schema, tables, expires_at);
463463
let (status, resp_body) = api.post_raw("/databases", &body);
464464
if !status.is_success() {
465465
eprintln!("{}", crate::util::api_error(resp_body).red());
@@ -493,7 +493,7 @@ fn mint_database_token(api: &ApiClient, database_id: &str) -> DatabaseTokenRespo
493493
pub fn run(
494494
database: Option<&str>,
495495
workspace_id: &str,
496-
description: Option<&str>,
496+
name: Option<&str>,
497497
schema: &str,
498498
tables: &[String],
499499
expires_at: Option<&str>,
@@ -509,7 +509,7 @@ pub fn run(
509509
// for the child process, addressed only by the token we mint below.
510510
let database_id = match database {
511511
Some(id) => id.to_string(),
512-
None => create_and_return_id(&api, description, schema, tables, expires_at),
512+
None => create_and_return_id(&api, name, schema, tables, expires_at),
513513
};
514514

515515
let resp = mint_database_token(&api, &database_id);

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ fn main() {
403403
// group-level name_or_id is treated as a `show` shorthand.
404404
if let Some(DatabasesCommands::Run {
405405
database,
406-
description,
406+
name,
407407
schema,
408408
tables,
409409
expires_at,
@@ -414,7 +414,7 @@ fn main() {
414414
databases::run(
415415
db,
416416
&workspace_id,
417-
description.as_deref(),
417+
name.as_deref(),
418418
&schema,
419419
&tables,
420420
expires_at.as_deref(),

0 commit comments

Comments
 (0)