> On Apr 24, 2024, at 8:19 AM, Martin Blais <[email protected]> wrote:
> 
> Oh wow, that's crazy cool. I didn't know postgresql supported that!
> Will have a more detailed look, sorry for not digging in deeper


Martin, 

Thanks for your interest. This started as a simple experimental side project, 
but I was able to take the implementation much further than I expected, and I 
thought it was cool enough to share with the Beancount community. To be honest, 
I'm not really sure what I want to do with it next, but I thought it would be 
interesting to get some feedback from the community to validate the idea. The 
current implementation covers my personal use cases, but I know that Beancount 
is used in many different ways, and I wonder if there is any other core 
functionality that might be missing.

The foundation of the idea is defining a custom type `amount` in PostgreSQL 
that combines a numeric (decimal) number with a commodity code. Then we can 
write custom functions to add and aggregate amounts to create balances of 
currencies, aggregate postings into lots for cost-basis calculations, and 
convert between different currencies.

I would say that currently, the biggest missing features I’m aware of revolve 
around validation. Although there are checks that transactions are balanced and 
that balance assertions are correct, there are some minor validation points and 
edge cases that are not yet addressed. I've made a list of the ones I can think 
of in the README, but there are probably more.

Another major missing feature is statement import. Since the data is just 
stored in a PostgreSQL database, it should be straightforward to write an 
importer—or convert an existing Beancount importer—to INSERT data directly into 
the database. However, I would consider this out of the scope of this project.

For my personal project, I am using Postgraphile to automatically expose a 
GraphQL API of the database and am writing a custom React-based front-end as a 
client to the data. For now, I’m still importing the Beancount data into the 
database and then exporting the changes back to a Beancount file, as Beancount 
still provides functionality that I need. But eventually, I could imagine 
moving everything to the database.

By the way, I just finished adding LIFO/FIFO cost-basis functions. Check the 
README for more details.

https://github.com/gerdemb/beanpost

Best Regards,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/51BA23C9-E9E6-44FE-AA18-5287C5C06068%40gerdemann.org.

Reply via email to