"""Database CLI commands.""" import typer from app.adapters import aws_dsql from app.config import settings app = typer.Typer(no_args_is_help=True) @app.command("dsql-token") def dsql_token( expires_in: int | None = typer.Option(None, "--expires-in", "-e"), ) -> None: """Generate Aurora DSQL auth token.""" if not settings.dsql_endpoint: typer.secho("DSQL_ENDPOINT is not configured", fg=typer.colors.RED, err=True) raise typer.Exit(1) typer.echo(aws_dsql.generate_db_connect_admin_auth_token(expires_in=expires_in))