{"id":13492697,"url":"https://github.com/jonaslu/sider","last_synced_at":"2025-08-20T12:32:33.598Z","repository":{"id":33660776,"uuid":"148896164","full_name":"jonaslu/sider","owner":"jonaslu","description":"As git for your database(s) - commit, f*ckup, restore","archived":false,"fork":false,"pushed_at":"2024-02-17T11:37:09.000Z","size":1412,"stargazers_count":109,"open_issues_count":5,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-17T12:12:23.667Z","etag":null,"topics":["database","git","terminal","vcs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jonaslu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-15T11:30:25.000Z","updated_at":"2024-02-17T11:10:33.000Z","dependencies_parsed_at":"2024-02-17T06:24:43.732Z","dependency_job_id":"586905f2-82d1-46b2-89fc-a59ad7c7d2e5","html_url":"https://github.com/jonaslu/sider","commit_stats":{"total_commits":317,"total_committers":4,"mean_commits":79.25,"dds":"0.10410094637223977","last_synced_commit":"3f153570e3d544506cadd71e5b83bc57b4793b1f"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2Fsider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2Fsider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2Fsider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2Fsider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonaslu","download_url":"https://codeload.github.com/jonaslu/sider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230187677,"owners_count":18186959,"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":["database","git","terminal","vcs"],"created_at":"2024-07-31T19:01:08.371Z","updated_at":"2024-12-19T11:13:28.074Z","avatar_url":"https://github.com/jonaslu.png","language":"JavaScript","readme":"\u003cimg src=\"assets/logo.svg\" height=200 style=\"margin-bottom: 20px\"\u003e\n\n# Introduction\nSider is a command-line tool for installing, running, ruining and reverting databases locally..\n\n![The-power-of-sider](/assets/the-power-of-sider.gif?raw=true)\n\nSider was created because there's always a database somewhere. System-wide installs is cumbersome and reusing system-wide databases over several projects gets out of hand. Sider is a quick start and go solution.\n\nIn sider a fresh database is a simple terminal command away. Run it and when done shut it down via ctrl+c.\n\nInternally sider manages bind-mounts to persist the data and uses official docker images. You work on copies of your data and can revert back to the initial state anytime. You can also set and save ports and versions on each individual database.\n\n# For the impatient and brave\nSay to yourself: \"I have docker and nodejs installed\" three times.\n\n```\nnpm i -g @jonaslu/sider\nsider install-completion # Currently only bash supported\nsider help\nsider \u003ccommand\u003e help\nsider \u003ctab\u003e\u003ctab\u003e\n```\n\nSider was built by swedish hands and is therefore obnoxiously overly helpful. Each command and subcommand comes with an explanatory help. Just leave out any mandatory parameter and there wil be a help message to get you moving.\n\nCheck the [wiki](https://github.com/jonaslu/sider/wiki) - at least the [changelog](https://github.com/jonaslu/sider/wiki/Changelog) if you are upgrading.\n\n# Table of contents\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Installation](#installation)\n  - [Prerequisites](#prerequisites)\n  - [Getting it](#getting-it)\n- [Quick guide](#quick-guide)\n  - [Engine](#engine)\n  - [Snapshots](#snapshots)\n  - [Databases](#databases)\n  - [Runtime settings](#runtime-settings)\n  - [Configuration file](#configuration-file)\n- [More commands](#more-commands)\n  - [Listing settings](#listing-settings)\n  - [Removing settings](#removing-settings)\n  - [Removing snapshots and databases](#removing-snapshots-and-databases)\n  - [Renaming snapshots and databases](#renaming-snapshots-and-databases)\n  - [Ejecting and promoting](#ejecting-and-promoting)\n- [Upgrading from an older version](#upgrading-from-an-older-version)\n- [Changelog](#changelog)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# Installation\n\n## Prerequisites\nSider depends on the [docker cli](https://docs.docker.com/engine/reference/commandline/cli/) for running the different supported database engines. You must have docker installed and on your path.\n\nType: `docker info` in  a terminal. You'll get a `command not found` if docker is not installed.\n\n## With nodejs already installed\n`npm install -g @jonaslu/sider`\n\n## Via homebrew\n```\nbrew tap jonaslu/tools\nbrew install sider\n```\n\n\n# Quick guide\nThe most essential commands and terminology in sider to get you going.\n\nIf you're running bash you can type `sider install-completion` and tab-tab away to your hearts content.\nSee [issues](https://github.com/jonaslu/sider/issues) for progress on more shells.\n\n## Engine\nThe supported database types are called an engine. Currently supported:\n- Redis\n- Postgres\n- Mariadb\n- Mongodb\n\n## Snapshots\nA snapshot is a holder of files containing data. A snapshot is immutable once created. You can import existing data-files from another engine of the same type or create an empty snapshot and seed it with data yourself.\n\nSider supports importing:\n* Redis [snapshot](https://redis.io/docs/management/persistence/#snapshotting) file [dump.rdb](https://redis.io/docs/manual/persistence/#snapshotting)\n* Mongodbs [data-directory](https://www.mongodb.com/docs/manual/tutorial/manage-mongodb-processes/#start-mongod-processes) directory\n* Postgres [data-directory](https://www.postgresql.org/docs/current/storage-file-layout.html) which defaults to `/var/lib/pgsql/data`\n* Mariadbs [data-directory](https://mariadb.com/docs/skysql-dbaas/ref/mdb/system-variables/datadir/) which defaults to `/var/lib/mysql`\n\nDumps produced by [mongodump](https://www.mongodb.com/docs/database-tools/mongodump/), [mariadb-dump/mysqldump](https://mariadb.com/kb/en/mariadb-dump/) and [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.htm) cannot be imported directly as snapshots. They can easily be restored into an running empty snapshot. Reasons and procedure described [here](https://github.com/jonaslu/sider/wiki/Copy-a-live-postgres-database).\n\nImport data-files as a snapshot:\n```\nsider snapshot add \u003cengine-name\u003e \u003csnapshot-name\u003e \u003cpath-to-data-files\u003e\n```\n\nCreate an empty snapshot:\n```\nsider snapshot empty \u003cengine-name\u003e \u003csnapshot-name\u003e\n```\nThen press `ctrl+c` once done manually seeding data.\n\nList all the snapshots:\n```\nsider snapshot list\n```\n\n## Databases\nThe database is a cloned copy of a snapshot. The data in a database is mutable.  This is what you use when you do work.\n\nClone database from a snapshot:\n```\nsider db clone \u003cdatabase-name\u003e \u003csnapshot-name\u003e\n```\n\nStart the database:\n```\nsider db start \u003cdatabase-name\u003e\n```\n\nAny logs from the engine is written to the terminal. Press `ctrl+c` to shut down the database. Databases can be started again whereas snapshots are either imported or seeded once.\n\nReset back the database to it's initial cloned state:\n```\nsider db reset \u003cdatabase-name\u003e\n```\n\nList all the databases:\n```\nsider db list\n```\n\nThe listing contains info on creation date, last usage date, originating snapshot and optionally the settings (via the `-s` flag).\n\n## Runtime settings\nEach engine (database type) has settings that control what port and what version you run, plus any custom settings supported by that engine.\n\n### Setting settings\nThe engine itself will provide the default port (e g port for MariaDB is 3306) and the latest version.\n\nIf the defaults are overriden on the engine level they apply for all cloned databases using that engine. If overriden on the snapshot level they apply for all cloned databases of that snapshot. If overridden on the database level they apply for all runs of that database. And if applied on the command line they apply only for that run of the database (unless the `-p` flag is given).\n\nSettings are prioritized in the order: engine, snapshot, database and command line. If the same setting is set on two or more levels the highest priority is applied.\n\nPersist settings on the respective level:\n```\nsider engine setconf \u003csetting1=value\u003e \u003csetting2=value\u003e ...\nsider snapshot setconf  \u003csetting1=value\u003e \u003csetting2=value\u003e ...\nsider db setconf  \u003csetting1=value\u003e \u003csetting2=value\u003e ...\nsider db start -p \u003ccloned-database\u003e \u003csetting1=value\u003e \u003csetting2=value\u003e ...\nsider snapshot empty -p \u003cengine-name\u003e \u003csnapshot-name\u003e \u003csetting1=value\u003e \u003csetting2=value\u003e ...\n```\n\nApply settings for this run but do not persist them:\n```\nsider db start \u003ccloned-database\u003e \u003csetting1=value\u003e \u003csetting2=value\u003e ...\nsider snapshot empty \u003cengine-name\u003e \u003csnapshot-name\u003e \u003csetting1=value\u003e \u003csetting2=value\u003e ...\n```\n\n**Example:** `sider engine setconf redis port=6780 version=3.2.6`\n\n**Example:** `sider engine remconf redis port version`\n\nPhew! Well done for getting this far. When you feel ready there is [more you can do](#more-commands).\n\n## Configuration file\nSider will by default put all snapshots, databases and stored settings in the `~/.sider` folder.\nYou can change this by adding an `~/.siderrc` file. The .siderrc is a json-file with the following format.\n```\n{\n  \"basePath\": \"~/.sider\"\n}\n```\n\n# More commands\nNow that you've got it going - there is more that you can do.\n\n## Listing settings\nList settings on the respective level:\n```\nsider engine getconf \u003cengine-name\u003e\nsider snapshot getconf \u003csnapshot-name\u003e\nsider db getconf \u003cdatabase-name\u003e\n```\n\nThe `-s` flag in `sider db list -s` will show a column with the settings actually applied (via priority) when the db is started.\n\n## Removing settings\nRemove settings on the respective level:\n```\nsider engine remconf \u003csetting1\u003e \u003csetting2\u003e ...\nsider snapshot remconf \u003csetting1\u003e \u003csetting2\u003e ...\nsider db remconf \u003csetting1\u003e \u003csetting2\u003e ...\n```\n\n## Removing snapshots and databases\nEven the finest database or snapshot eventually has to go.\n\nRemove a snapshot or database:\n```\nsider snapshot remove \u003csnapshot-name\u003e\nsider db remove \u003cdatabase-name\u003e\n```\n\nIf there are any cloned databases from a snapshot they will be removed when the snapshot is removed.\n\n## Renaming snapshots and databases\nWhen did you get the name right the first time? Thought so.\n\nRename a snapshot or database:\n ```\n sider snapshot mv \u003csnapshot-name\u003e \u003cnew-snapshot-name\u003e \n sider db mv \u003cdatabase-name\u003e \u003cnew-database-name\u003e\n ```\n\n## Ejecting and promoting\nIf you want to get the data-files out of a database (in order to import it elsewhere) you can do this via:\n```\nsider db eject \u003cdatabase-name\u003e \u003ceject-path\u003e\n```\n\nThe eject path will contain the ejected files.\n\nOnce in a while you get something right. If a database is so right it ought to be a snapshot instead this can be done via:\n```\nsider db promote \u003cdatabase-name\u003e \u003csnapshot-name\u003e\n```\n\n# Upgrading from an older version\nWhen any snapshots, databases or settings needs to be patched due to changes or bugs a migration is supplied.\n\nAny migrations are applied automatically when installing via npm as a postinstall hook.\nIf there are any errors during the migration an error log will be supplied.\n\nYou can (but are strongly advised not to to) opt out of the migration during upgrade by running `npm i -g --ignore-scripts @jonaslu/sider`.\nThe migrations can then manually be run via `sider migrate`. Not that sider might be broken until migrations are applied.\n\nCurrently there are migrations when upgrading from version:\n* v0.0.8\n* v1.0.0\n* v1.1.0\n\n# Changelog\nChanges from version to version are documented in the [changelog](https://github.com/jonaslu/sider/wiki/Changelog).","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaslu%2Fsider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonaslu%2Fsider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaslu%2Fsider/lists"}