select_seren_database

Function select_seren_database 

Source
pub async fn select_seren_database() -> Result<(String, TargetState)>
Expand description

Prompts the user to select a SerenDB project and database interactively.

This function will:

  1. Get the SerenDB API key (from environment or prompt).
  2. Fetch and display a list of projects for the user to select.
  3. Fetch the default branch for the selected project.
  4. Fetch and display a list of databases for the user to select.
  5. Return the connection string and target state for the selected database.

ยงReturns

A Result containing a tuple of (connection_string, TargetState) for the selected database. The TargetState contains the project_id, branch_id, and database name needed for remote execution.