{"id":18522375,"url":"https://github.com/sdelements/flan","last_synced_at":"2025-04-06T02:07:19.513Z","repository":{"id":37847183,"uuid":"382379577","full_name":"sdelements/flan","owner":"sdelements","description":"A tasty tool that lets you save, load and share postgres snapshots with ease","archived":false,"fork":false,"pushed_at":"2021-09-29T17:54:50.000Z","size":356,"stargazers_count":181,"open_issues_count":1,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T01:11:12.646Z","etag":null,"topics":["cli","command-line","git","postgres","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdelements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-02T14:56:59.000Z","updated_at":"2025-01-28T14:54:07.000Z","dependencies_parsed_at":"2022-08-19T22:10:15.801Z","dependency_job_id":null,"html_url":"https://github.com/sdelements/flan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdelements%2Fflan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdelements%2Fflan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdelements%2Fflan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdelements%2Fflan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdelements","download_url":"https://codeload.github.com/sdelements/flan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","git","postgres","postgresql","sql"],"created_at":"2024-11-06T17:30:22.785Z","updated_at":"2025-04-06T02:07:19.494Z","avatar_url":"https://github.com/sdelements.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"360\" height=\"166\" src=\"https://user-images.githubusercontent.com/1066160/126935125-b1f14451-4bdd-4dad-a283-9b20c4f668d3.png\" alt=\"flan\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb \u003eA tasty tool that lets you save, load and share postgres snapshots with ease.\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://oclif.io\"\u003e\u003cimg src=\"https://img.shields.io/badge/cli-oclif-brightgreen.svg\" alt=\"oclif\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/@sdelements/flan\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@sdelements/flan.svg\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/@sdelements/flan\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/@sdelements/flan.svg\" alt=\"Downloads/week\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/sdelements/flan/blob/master/package.json\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@sdelements/flan.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Usage\n\n```sh-session\n$ npm install -g @sdelements/flan\n\n$ flan init\nrunning setup...\n\n$ flan save mydb@1.0.0\nsaving...\n\n$ flan load mydb@1.0.0\nloading...\n\n$ flan publish mydb@1.0.0\npublishing...\n\n$ flan available\navailable snapshots...\n\n$ flan (-v|--version|version)\n@sdelements/flan/0.1.0-alpha.0 darwin-x64 node-v14.16.1\n\n$ flan --help [COMMAND]\nUSAGE\n  $ flan COMMAND\n...\n```\n\n# How it works\n\nUnder the hood flan is a convenient wrapper for `pgdump` and `pgrestore`. It uses parallel jobs by default to ensure dumping/restoring your database is quick.\n\nSharing database dumps is achieved by leveraging `git`. Essentially you push a tag to a repository of your choosing (defined in `flan.config.js`) and others can then pull it with `flan fetch`. We chose to use git because it fits well with our internal tooling and process but we understand it may not be the best solution for you. Pull requests are welcome if you're interested in using S3/Azure/etc as a store 🙂\n\n\u003e :warning: **WARNING**: Please don't use flan in situations where you can't afford data loss.\n\n# Commands\n\n\u003c!-- commands --\u003e\n\n- [`flan autocomplete [SHELL]`](#flan-autocomplete-shell)\n- [`flan available`](#flan-available)\n- [`flan delete DELETEFILE`](#flan-delete-deletefile)\n- [`flan fetch FILE`](#flan-fetch-file)\n- [`flan help [COMMAND]`](#flan-help-command)\n- [`flan init`](#flan-init)\n- [`flan list`](#flan-list)\n- [`flan load INPUT`](#flan-load-input)\n- [`flan publish FILE`](#flan-publish-file)\n- [`flan save OUTPUT`](#flan-save-output)\n- [`flan unpublish FILE`](#flan-unpublish-file)\n\n## `flan autocomplete [SHELL]`\n\ndisplay autocomplete installation instructions\n\n```\nUSAGE\n  $ flan autocomplete [SHELL]\n\nARGUMENTS\n  SHELL  shell type\n\nOPTIONS\n  -r, --refresh-cache  Refresh cache (ignores displaying instructions)\n\nEXAMPLES\n  $ flan autocomplete\n  $ flan autocomplete bash\n  $ flan autocomplete zsh\n  $ flan autocomplete --refresh-cache\n```\n\n_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v0.3.0/src/commands/autocomplete/index.ts)_\n\n## `flan available`\n\nlists available dumps\n\n```\nUSAGE\n  $ flan available\n\nOPTIONS\n  -c, --config=config     [default: ./flan.config.json] Path to configuration file\n  -x, --extended          show extra columns\n  --columns=columns       only show provided columns (comma-separated)\n  --csv                   output is csv format [alias: --output=csv]\n  --filter=filter         filter property by partial string matching, ex: name=foo\n  --no-header             hide table header from output\n  --no-truncate           do not truncate output to fit screen\n  --output=csv|json|yaml  output in a more machine friendly format\n  --sort=sort             [default: tag] property to sort by (prepend '-' for descending)\n\nEXAMPLE\n  $ flan available\n```\n\n_See code: [src/commands/available.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/available.ts)_\n\n## `flan delete DELETEFILE`\n\ndelete a local database dump\n\n```\nUSAGE\n  $ flan delete DELETEFILE\n\nARGUMENTS\n  DELETEFILE  name of file to delete\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n\nEXAMPLES\n  $ flan delete myDB\n  $ flan delete myDB@1.0.0\n```\n\n_See code: [src/commands/delete.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/delete.ts)_\n\n## `flan fetch FILE`\n\nfetch specified dump file from a remote repository\n\n```\nUSAGE\n  $ flan fetch FILE\n\nARGUMENTS\n  FILE  name of the file\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n\nEXAMPLE\n  $ flan fetch filename\n```\n\n_See code: [src/commands/fetch.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/fetch.ts)_\n\n## `flan help [COMMAND]`\n\ndisplay help for flan\n\n```\nUSAGE\n  $ flan help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.2/src/commands/help.ts)_\n\n## `flan init`\n\nInitializes flan for this project\n\n```\nUSAGE\n  $ flan init\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n  -y, --yes            Auto confirm directory creating questions\n\nEXAMPLES\n  $ flan init\n  Config file found at home/flan.config.js\n\n  $ flan init\n  A config file will be created, continue? [y/n]\n\n  $ flan init -c /some-folder/flan.config.json\n  Config file found at home/flan/some-folder/flan.config.json\n\n  $ flan init -y -c /some-folder/flan.config.json\n  Config file found at /home/flan/some-folder/flan.config.json\n  The base directory has been created successfully at /home/flan/some-folder/.flan\n  The save directory has been created successfully at /home/flan/some-folder/.flan/local\n  Git repository initialized at /home/flan/some-folder/.flan/repo\n```\n\n_See code: [src/commands/init.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/init.ts)_\n\n## `flan list`\n\nlists available dumps\n\n```\nUSAGE\n  $ flan list\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n\nEXAMPLE\n  $ flan list\n```\n\n_See code: [src/commands/list.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/list.ts)_\n\n## `flan load INPUT`\n\nload database from dump\n\n```\nUSAGE\n  $ flan load INPUT\n\nARGUMENTS\n  INPUT  name of input file\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n  --drop-db            Drops and re-creates the DB before restoring it's data\n  --quiet              Supress errors from pg_restore\n\nEXAMPLES\n  $ flan load myDB\n  $ flan load --drop-db --quiet myDB\n```\n\n_See code: [src/commands/load.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/load.ts)_\n\n## `flan publish FILE`\n\npublish specified dump file to a remote repository\n\n```\nUSAGE\n  $ flan publish FILE\n\nARGUMENTS\n  FILE  name of the file\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n\nEXAMPLE\n  $ flan publish filename\n```\n\n_See code: [src/commands/publish.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/publish.ts)_\n\n## `flan save OUTPUT`\n\nsave current database to dump\n\n```\nUSAGE\n  $ flan save OUTPUT\n\nARGUMENTS\n  OUTPUT  name of output file\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n\nEXAMPLE\n  $ flan save myDB\n```\n\n_See code: [src/commands/save.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/save.ts)_\n\n## `flan unpublish FILE`\n\nunpublish specified database dump from a remote repository\n\n```\nUSAGE\n  $ flan unpublish FILE\n\nARGUMENTS\n  FILE  name of the file\n\nOPTIONS\n  -c, --config=config  [default: ./flan.config.json] Path to configuration file\n\nEXAMPLE\n  $ flan unpublish myDB@1.0.0\n```\n\n_See code: [src/commands/unpublish.ts](https://github.com/sdelements/flan/blob/v0.1.0-alpha.10/src/commands/unpublish.ts)_\n\n\u003c!-- commandsstop --\u003e\n\n\u003chr /\u003e\n\n\u003cp align=\"center\"\u003e\n  From Toronto with love ❤️\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  👩‍🍳 :pie: 👨‍🍳 :pie: 👩‍🍳 :pie: 👨‍🍳 :pie: 👨‍🍳\n  \u003cbr /\u003e\n  \u003csub\u003eBuilt by Team Pie\u003c/sub\u003e\n  \u003cbr /\u003e\n  \u003csub\u003eSpecial thanks to \u003ca href=\"https://github.com/revangel\"\u003e@revangel\u003c/a\u003e for the logo\u003c/sub\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdelements%2Fflan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdelements%2Fflan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdelements%2Fflan/lists"}