Skip to content

A simple double-entry ledger with source and destination accounts in SQL

blog.nxos.io
6 pointsBillyTheKing1 comment
On HN

Comments

Hey everyone! I wrote a blog post about building a simple double-entry ledger using just simple SQL. It covers implementing a ledger with source and destination accounts, using a simple table structure and straight-forward SQL queries for balance calculations. I use negative and positive amounts instead of traditional debit and credit columns. In my opinion, this from/to model is easier to reason about and visualize in graph form, while still allowing credit/debit terminology to be built on top if needed. Would love to hear your thoughts!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.