Skip to content
Browse files

Little useful functions to load database dumps

  • Loading branch information...
1 parent c7d98c4 commit e33218a7288b1a40b2cdc878182422c648a511d6 Roger Campos committed Feb 22, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 bash/bash.symlink/aliases
View
26 bash/bash.symlink/aliases
@@ -12,3 +12,29 @@ function duf {
alias open="gnome-open"
alias git=hub
+
+load_pg_dump () {
+ if [ -z "$1" ]; then
+ echo "Tell me the target database"
+ return 1
+ fi
+ if [ -z "$2" ]; then
+ echo "Tell me the sql file to dump"
+ return 1
+ fi
+
+ psql -U postgres -d $1 -f $2
+}
+
+load_mysql_dump () {
+ if [ -z "$1" ]; then
+ echo "Tell me the target database"
+ return 1
+ fi
+ if [ -z "$2" ]; then
+ echo "Tell me the sql file to dump"
+ return 1
+ fi
+
+ mysql -u root $1 < $2
+}

0 comments on commit e33218a

Please sign in to comment.
Something went wrong with that request. Please try again.