Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/BenjaminFaal/pgtt
pgtt is a time traveling tool for PostgreSQL to help speedup development and testing of various applications by enabling the user to easily travel between points in time. This can be useful when for example you have to test a certain mutation multiple times and want to quickly rollback to before the mutation to make changes to the behaviour and test again. This will save time and avoids setting up the data over and over again, especially in larger applications with complex data and flows.
https://github.com/BenjaminFaal/pgtt
backup copy database postgres postgresql restore snapshot sql time timetravel timetraveling traveling
Last synced: about 2 months ago
JSON representation
pgtt is a time traveling tool for PostgreSQL to help speedup development and testing of various applications by enabling the user to easily travel between points in time. This can be useful when for example you have to test a certain mutation multiple times and want to quickly rollback to before the mutation to make changes to the behaviour and test again. This will save time and avoids setting up the data over and over again, especially in larger applications with complex data and flows.
- Host: GitHub
- URL: https://github.com/BenjaminFaal/pgtt
- Owner: BenjaminFaal
- License: gpl-3.0
- Created: 2021-08-13T13:21:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-28T10:53:21.000Z (about 2 years ago)
- Last Synced: 2024-11-21T20:18:54.819Z (2 months ago)
- Topics: backup, copy, database, postgres, postgresql, restore, snapshot, sql, time, timetravel, timetraveling, traveling
- Language: Svelte
- Homepage:
- Size: 110 KB
- Stars: 23
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pgtt
pgtt is a time traveling tool for PostgreSQL to help speedup development and testing of various applications by enabling the user to easily travel between points in time. This can be useful when for example you have to test a certain mutation multiple times and want to quickly rollback to before the mutation to make changes to the behaviour and test again. This will save time and avoids setting up the data over and over again, especially in larger applications with complex data and flows.### How it works
PostgreSQL supports creating databases with a [TEMPLATE](https://www.postgresql.org/docs/current/sql-createdatabase.html). pgtt utilises this to create a copy of a database. Once the user wants to time travel to a specific copy pgtt simply replaces the current database with the copy.PostgreSQL enforces there are no active connections to the database when copying or restoring. pgtt will simply terminate all connections to that database before these actions. This can result in your application crashing or not being able to connect to the database while copying.
## Usage
[Docker image](https://github.com/BenjaminFaal/pgtt/pkgs/container/pgtt)Use the [docker-compose.yml](docker-compose.yml) for a good starting point to see how to configure and use pgtt.
## Development
1. Setup a PostgreSQL database
2. Setup the [.env](.env.development) file accordingly
3. `npm install`
4. `npm run dev`