Sign inSign up
farm logo

apolitical/farm

By apolitical

•Updated about 8 years ago

Find And Replace in MySql

Image
0

5.4K

apolitical/farm repository overview

⁠Farm

GitHub release GitHub license

A find and replace tool for MySql. Given a --find string, it will find all occurrences within a a schema and replace it with a --replace string.

⁠Example Usage

$ farm \
    --database mysql://user:password@localhost:3306/wordpress \
    --find https://apolitical.co \
    --replace http://localhost:8080

⁠Installation

Clone this repository and run cargo install.

⁠Docker

This repository is available on Docker

Usage:

docker run --rm -it apolitical/farm --database <db-url> --find <find> --replace <replace>

or

docker run --rm  apolitical/farm --database <db-url> --find <find> --replace <replace> -y

If your database is also in docker, don't forget --link <my-db-container-name>

The entry point is farm, so you do not need to add the binary name.

⁠Environment variables

Sometimes you may not be able to pass in variable command line arguments (for example, when using farm in a Kubernetes Job⁠). You can pass the above options in as the environmental variables DATABASE, FIND, REPLACE, RECKLESS_MODE.

Warning: The environment variables will be used for anything that isn't passed in on the command line. This is mostly fine, but RECKLESS_MODE doesn't take a parameter and therefore can not be turned off if you have an environment variable called RECKLESS_MODE for any reason.

Tag summary

Content type

Image

Digest

Size

2.7 MB

Last updated

about 8 years ago

docker pull apolitical/farm