Skip to content

Instantly share code, notes, and snippets.

@mupkoo
Last active October 24, 2022 09:26
Show Gist options
  • Select an option

  • Save mupkoo/8e7161113749ab8408c90c93e5219a42 to your computer and use it in GitHub Desktop.

Select an option

Save mupkoo/8e7161113749ab8408c90c93e5219a42 to your computer and use it in GitHub Desktop.

Revisions

  1. mupkoo revised this gist Oct 24, 2022. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions postgresql-with-docker.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    for db in (docker exec -i pg12 psql -U postgres -t -c "SELECT datname FROM pg_database WHERE datname NOT ILIKE '%_test%' AND datname NOT IN ('postgres', 'template0', 'template1')");
    docker exec -i pg12 pg_dump (string trim $db) -U postgres --no-owner --no-acl --clean --create --if-exists -F custom > (string trim $db).dump;
    end

  2. mupkoo revised this gist Jan 10, 2022. No changes.
  3. mupkoo revised this gist Mar 29, 2021. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions mysql.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    for db in (mysql -u root -e "SHOW DATABASES WHERE `Database` NOT LIKE '%test%'" -s --skip-column-names);
    mysqldump -u root --single-transaction (string trim $db) > (string trim $db).dump;
    end
  4. mupkoo renamed this gist Mar 29, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. mupkoo created this gist Mar 29, 2021.
    3 changes: 3 additions & 0 deletions dump.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    for db in (psql -t -c "SELECT datname FROM pg_database WHERE datname NOT ILIKE '%_test%'");
    pg_dump (string trim $db) --no-owner --no-acl --clean --create --if-exists -F custom > (string trim $db).dump;
    end