Skip to content

cli:cockroach sql command should have -f option to pass sql file #42955

@dbist

Description

@dbist

Is your feature request related to a problem? Please describe.
today, I only see an option of passing a sql command to cockroach sql with --execute flag. I'd like to see an option to pass a file instead. Lack of this ability forces one to do bash trickery to pass a file like so cockroach sql --insecure --host=localhost:26257 --database="tabular_import" --execute="$(< import_statement.sql)

Describe the solution you'd like
a more convenient solution is to see an option to pass a file with a switch like -f

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions