# README

Git Based Application Configuration
Konfigraf is a Postgres extension that allows you to store and manipulate data in Git repositories stored in tables within the database. This is designed to be used for storage of configuration data for applications and services.
Example usage:
-- A repository must be created before any other actions are possible
SELECT create_repository('my-repository')
-- Files can be created or updated using the commit_file function
SELECT commit_file('my-repository', 'app/config.json','{"value": [1,2,3]}','John Doe','Set Value', '[email protected]');
-- Return the file as a string
SELECT get_file('my-repository','app/config.json') AS config
-- List files for a given path as an array of strings
SELECT list_files('my-repository','app');
-- Since these are just SQL functions, they can be combined with queries
-- Here we update one value in a configuration
SELECT commit_file('my-repository', 'app/config.json',get_file('my-repository','app/config.json')::jsonb || '{"max":42}'::jsonb,'John Doe','Update max value', '[email protected]');
-- Return a single value from a configuration
SELECT get_file('my-repository','app/config.json')::jsonb->'max' AS maximum
# Functions
Commits a file on a specific branch.
Commits a file on the master branch.
Creates a new branch.
Creates a new repository and returns the repository ID.
Removes an existing branch.
Deletes the specified repository.
Gets a file from a repository at the specified path of the master branch.
Lists files from a specific path of the master branch.
Gets a file from a repository at the specified path of the master branch.
Gets log from the master branch.
Lists files from a specific path of the specified branch.
Lists files from a specific path of the master branch.