Skip to content

Conversation

@diego-feito-stori
Copy link

@diego-feito-stori diego-feito-stori commented Nov 25, 2025

Description

Add -f/--file option to execute SQL commands from file

Implements the -f/--file command-line option similar to psql's behavior.
This allows executing SQL commands from a file and then exiting.

Features:

  • Support for -f and --file (short and long forms)
  • Multiple files can be specified (-f file1 -f file2)
  • Can be combined with -c option (-c commands execute first, then -f files)
  • Pager is disabled in file mode (consistent with -c behavior)
  • Comprehensive BDD tests added for all scenarios
  • Version bumped to 4.3.1 (probably must be rollbacked)

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install).
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

Test Logs

behave.file.1.log - behave.file.2.log - pytest.file.1.log

diego-feito-stori and others added 4 commits November 19, 2025 16:19
   Implements the -f/--file command-line option similar to psql's behavior.
   This allows executing SQL commands from a file and then exiting.

   Features:
   - Support for -f and --file (short and long forms)
   - Multiple files can be specified (-f file1 -f file2)
   - Can be combined with -c option (-c commands execute first, then -f files)
   - Pager is disabled in file mode (consistent with -c behavior)
   - Comprehensive BDD tests added for all scenarios
   - Version bumped to 4.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants