Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A simple double-entry ledger with source and destination accounts in SQL (nxos.io)
6 points by BillyTheKing on July 17, 2024 | hide | past | favorite | 1 comment


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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: