gofr-dev / gofr

An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.
https://gofr.dev
Apache License 2.0
3.61k stars 243 forks source link

interface error using badger.client as container.KVStoreProvider #1166

Closed marvfinsy closed 3 weeks ago

marvfinsy commented 4 weeks ago

Describe the bug Attempting to use badger as KVStore. Following example in GoFr doc. Also how do configure as internal DS. Example in badger docs but sure with your budget.client?

To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

    b := badger.New(badger.Configs{DirPath: "badger-example"})
    app.AddKVStore(b)
    
  2. The error is

    cannot use b (variable of type *"gofr.dev/pkg/gofr/datasource/kv-store/badger".client) as container.KVStoreProvider value in argument to app.AddKVStore: *"gofr.dev/pkg/gofr/datasource/kv-store/badger".client does not implement container.KVStoreProvider (missing method UseTracer)   
    

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environments (please complete the following information):

Intel Mac osx

require gofr.dev v1.24.2

go version 1.23.2

More description Add any other context about the problem here.

I also notice that my editor does not see the UseTracer() method being available on the badger.client. But i do see the UseTracer() method when looking at GoFr in GitHub.

Marvin email: marvinfoster@finsync.com & mmarvb7@gmail.com

coolwednesday commented 3 weeks ago

Hey @marvfinsy! 😊

Thank you so much for reporting this issue! We're actively working on adding tracing support across all the datasources, and it seems like the recent interface changes may have caused this hiccup. We’ll definitely look into it, and you can expect a fix in the next release!

Thanks for being part of the GoFr community! 🚀

coolwednesday commented 3 weeks ago

@marvfinsy, The issue has been fixed in our latest release v1.25.0, so BadgerDB v0.2.0 should now work smoothly. Feel free to give it a try, and let us know if you have any further questions.

Upgrade the badger DB dependency using go get gofr.dev/pkg/gofr/datasource/kv-store/badger@latest

marvfinsy commented 2 weeks ago

@vipul-rawat thx for the information... i'm trying new realease now...

marvfinsy commented 2 weeks ago

seems to be working... thx...