Skip to content

Instantly share code, notes, and snippets.

@kurko
Created April 6, 2011 23:37
Show Gist options
  • Save kurko/906764 to your computer and use it in GitHub Desktop.
Save kurko/906764 to your computer and use it in GitHub Desktop.
Sketching a good syntax for Omniscient gem.
# Omniscient is a gem that automatically dumps a MySQL database in a remote server,
# copies the dumped file to localhost via scp and imports it, overwriting the local
# database (or table).
# It'll be very useful for those that are developing using more than one machine and
# don't want to dump and clone data manually.
# Setup a new host machine
$ omniscient add
# If during setup, you selected 'dbname' as your standards database,
# clone 'dbname' database from a known host called 'aliasname'.
$ omniscient clone aliasname
# Clone 'custom_dbname' database from a known host called 'aliasname'.
$ omniscient clone aliasname -d custom_dbname
# Clone a specific table called my_table
$ omniscient clone aliasname -d dbname -t my_table
# Dump a remote database, copies it via scp but don't import
$ omniscient dump aliasname -d database
@juscombr
Copy link

juscombr commented Apr 7, 2011

You can use a file with configurations, like: omniscient --config /var/foo/my-config.yml

Or a default file at ~/.my-default-config.yml.

@caironoleto
Copy link

jusnavigandi it's me! :D

@kurko
Copy link
Author

kurko commented Apr 7, 2011

I'm doing just that: ~/.omniscient_config.yml

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment