Run SQL file
- PostgreSQL
- MySQL
- MariaDB
Run SQL file executes a script without opening it in an editor. The file streams through the
statement splitter in the job runner, so large dumps run in flat memory. DELIMITER, dollar
quoting and comments are handled as in the query editor, and the file’s own BEGIN and COMMIT
run as written.
Run a file
Section titled “Run a file”- Right-click a connection or a database in the sidebar and choose Run SQL file….
- Choose Choose file… and pick a
.sqlfile, or a gzip-compressed one. The dialog shows its size and the first statements. - Under When a statement fails, pick Stop or Log it and continue.
- Choose Run.
Progress and failed statements show in the Jobs panel. Each failed statement is listed with its statement number, line and error message.
Run a file on a schedule
Section titled “Run a file on a schedule”Instead of Run, choose Schedule… to run the file on a schedule. Each run executes the file as it is at that moment. On a production or confirm-writes profile, Querybara asks once, when you schedule it (Schedule it), and the runs do not ask again.
From the command line
Section titled “From the command line”querybara run-file runs a file the same way. By default it stops at the first failed statement;
--continue keeps going, and --error-log writes the failed statements and their errors to a
file. It exits 0 when every statement ran, 1 when some failed with --continue, 2 when it stopped
at a failure, and 130 when interrupted.
querybara run-file dev migrate.sqlquerybara run-file "postgres://[email protected]/shop" dump.sql.gz --continue --error-log errors.logResult rows are discarded; use querybara query -f to see them.
Related
Section titled “Related”Documents Querybara 0.1.1 · built frombc9f5aa