Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cannadayr/git-sqlite
A custom diff and merge driver for sqlite
https://github.com/cannadayr/git-sqlite
git sqlite
Last synced: about 13 hours ago
JSON representation
A custom diff and merge driver for sqlite
- Host: GitHub
- URL: https://github.com/cannadayr/git-sqlite
- Owner: cannadayr
- License: mit
- Created: 2017-07-08T22:01:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T23:55:50.000Z (over 3 years ago)
- Last Synced: 2024-02-13T21:49:29.806Z (9 months ago)
- Topics: git, sqlite
- Language: Shell
- Size: 62.5 KB
- Stars: 161
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## SYNOPSIS
git-sqlite is a collection of shell scripts that allows a sqlite database
to be tracked using the git version control system.It can be used on an existing database, however, UUIDs will make
multi-master distribution substantially easier.See src/schema.sql after building the project for an example.
## USAGE GUIDE
create a new database using the git-sqlite example schema:
```
git-sqlite init newdatabase.db
```attach the database to your repository (has to be done once for each repo):
```
git-sqlite attach newdatabase.db
```show a diff using the git-sqlite diff driver:
```
git show-sql
```resolve a merge conflict (after manually editing the merge_file)
```
git apply-sql
```## INSTALLING GIT-SQLITE
Dependencies:
* sqlite3
* sqldiff
* bash
* git
* autotools (build-essential debian repositories)As of Debian Stretch (release 9), sqldiff is included with the default sqlite3 apt package.
If it is not available for your distribution, see `INSTALLING SQLDIFF` below.
If you are installing from the git src:
```
./reconf
./configure
sudo make install
```If you are installing from a release, do this:
```
./configure
sudo make install
```## INSTALLING SQLDIFF
```
wget https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release
tar xzf sqlite.tar.gz?r=release
cd sqlite
./configure
make sqldiff
sudo install sqldiff /usr/local/bin/
```See https://www.sqlite.org/download.html for more information
## KNOWN ISSUES
* can't detect diffed triggers and views (should be resolved upstream in sqldiff)
* new columns from alter table dont have explicit types
* merge conflicts don't interleave## TODOS
* uuid version 1 style
* cleanup diff headers to be closer to what git does
* test cherry-picking## NOTES
* `git gc` may need to be run periodically