{"repo":"pgr0ss/pgledger","free":true,"listed":false,"github":"https://github.com/pgr0ss/pgledger","clone":"git clone https://github.com/pgr0ss/pgledger.git","description":"A double entry ledger implementation in PostgreSQL","language":"Go","stars":481,"topics":["double-entry-bookkeeping","double-entry-ledger","financial-ledger","ledger","postgresql","sql"],"license":"MIT","category":"databases-storage","readme_excerpt":"pgledger A double entry ledger implementation in PostgreSQL. Why pgledger Ledgers are a fundamental building block of any software that deals with money. It’s incredibly important to know what money is where, how it got there, and what it’s for. Yet most companies build their own internal ledger from scratch. pgledger is a reusable ledger implementation that works across projects and programming languages. There is no application-level code; the entire thing is implemented in PostgreSQL tables, functions, and views. The application just calls SQL functions and queries data via SQL views. Furthermore, since pgledger lives entirely in PostgreSQL, it allows transactional guarantees with the rest of the application. Do some work, write to the ledger, and it all commits or doesn't atomically. For more in-depth information and rationale, check out these blog posts: - Ledger Implementation in PostgreSQL - A Ledger In PostgreSQL Is Fast! - Double-Entry Ledgers: The Missing Primitive in Modern Software Installation The ledger implementation is currently in a single file: pgledger.sql. But it also relies on some helper ULID/UUID functions from scoville/pgsql-ulid (see #IDS for more information). I vendored the helpers in this repository for simplicity and compatibility (in case the pgsql-ulid library changes). To install, run the following SQL files using whatever database migration tool or method you prefer: 1. First run the SQL files from the vendored scoville/pgsql-ulid: - vendor/sc","default_branch":null,"files":null,"tree":[],"storefront":"/r/pgr0ss","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pgr0ss/pgledger/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}