sqcr
is a simple application that reads SQL files from the command line and executes the queries within them.
This tool allows for efficient database management and data manipulation directly from the command line.
- Read and execute SQL queries from files specified in the command line.
Please note that sqcr
currently only supports MySQL databases.
Ensure that your database and queries are compatible with MySQL.
Before using sqcr
, you need to set up a .env
file with the following format for your database connection:
DATABASE_URL=mysql://<user-name>:<password>@<host>:<port>/<database-name>
sqcr
currently only supports MySQL.
To use sqcr
, simply pass the file containing your SQL queries as an argument to the command line.
Ensure that the queries in the file are compatible with MySQL. For example:
sqcr query-file.sql
Binary distributions are not provided, so you will need to build the application in your own environment. Follow these steps to build:
- Clone the repository:
git clone <repository-url>
- Move to the project's root path:
cd sqcr
- Build the project using
cargo build
:
cargo build --release
This command compiles the project in release mode, creating an optimized executable binary.
After building, the executable file can be found in the target/release directory within your project folder.