git-sql

Crates.iogit-sql
lib.rsgit-sql
version0.0.1
sourcesrc
created_at2018-01-15 04:09:34.451397
updated_at2018-01-15 04:09:34.451397
descriptionGit on SQL
homepage
repository
max_upload_size
id46857
size73,391
Alex Zenla (azenla)

documentation

https://docs.rs/git-sql

README

Git SQL

This is an experimental implementation of Git storage and operations on top of PostgreSQL.

Why

Git is a very flexible platform for version control and content-addressable storage. GitSQL aims to take advantage of the server-side abilities of PostgreSQL to implement Git operations using PostgreSQL features. This is still experimental, and is not recommended for production use.

Installation

Install from Git:

cargo install git-sql --git https://github.com/SpinlockLabs/GitSQL.git

Install from crates.io:

cargo install git-sql

Usage

  • Create a database in PostgreSQL, such as gitdb.
  • Create a configuration file as gitdb.toml:
# Repositories are specified under named tables.
[repositories.mygitrepo]
# The URL to connect to the database.
postgres-url = "postgres://127.0.0.1/gitdb"
# A path to a local repository, used to update the SQL repository.
local-path = "/path/to/my/local/repo"

# Git Server Configuration
# URL format: http://myhost:port/mygitrepo
[server]
# Binds to the given host and port.
bind = "0.0.0.0:3020"
  • Initialize the GitSQL schema:
git-sql -c config.toml -r mygitrepo init
  • Import the Git repository into the SQL database:
git-sql -c config.toml -r mygitrepo update
  • Run the Git server:
git-sql -c config.toml serve
  • Clone the repository:
git clone http://localhost:8080/mygitrepo
Commit count: 0

cargo fmt