Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Latest commit

 

History

History
67 lines (33 loc) · 1.57 KB

README.md

File metadata and controls

67 lines (33 loc) · 1.57 KB

SQL Variable Replacer

Building

This tool is build against Rust 1.45.0+.

  • Install Rust if needed (See below). This should provide you with the cargo build command.

  • Clone this repo

  • cd to repo

  • cargo build --release --target x86_64-unknown-linux-musl

This builds a standalone executable in the target\release folder.

Usage

Use -v to specify replacements, -f to specify the file. Example:

clotho -v col1="'names'" -v col2=ages'' -v col3='"names2"' -v limit=14 -f check.txt

Testing against an SQL file

compile and run the file using cargo run, pass -- to cargo to then pass command line arguments to the app.

Example:

  • cargo run -- -v col1="'names'" -v col2=ages'' -v col3='"names2"' -v limit=14 -f check.txt

Running the executable

  • Build the file (See Building)

  • Copy the standalone executable from target\release to a desired location

  • Run the executable. Example:

clotho -v col1="'names'" -v col2=ages'' -v col3='"names2"' -v limit=14 -f ../..check.txt

Installing Rust

Linux
  • Install Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  • Add musl library to allow building static binaries:

rustup target add x86_64-unknown-linux-musl

  • Make it the default toolchain (optional):

rustup default x86_64-unknown-linux-musl

Windows

Download and run rustup-init

Updating Rust

When a new stable version of Rust comes out, you can update any machine where Rust was already installed via:

rustup update