Files
cdk/crates/cdk-sql-common
vnprc 1a493d61f8 feat: optimize SQL balance calculation (#1152)
* feat: optimize SQL balance calculation

replace proof-fetching approach with SUM aggregation

- add get_balance() method to Database trait
- implement SQL SUM aggregation in cdk-sql-common
- update total_balance() to use get_balance() instead of get_unspent_proofs()
- redb impl maintains existing behavior

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
Co-authored-by: Cesar Rodas <cesar@rodasm.com.py>
2025-10-06 10:29:57 +02:00
..
2025-07-29 11:31:23 -03:00
2025-09-09 13:26:03 +01:00
2025-07-29 11:31:23 -03:00

CDK SQL Base

This is a private crate offering a common framework to interact with SQL databases.

This crate uses standard SQL, a generic migration framework a traits to implement blocking or non-blocking clients.

ALPHA This library is in early development, the API will change and should be used with caution.

Features

The following crate feature flags are available:

Feature Default Description
wallet Yes Enable cashu wallet features
mint Yes Enable cashu mint wallet features
auth Yes Enable cashu mint auth features

License

This project is licensed under the MIT License.