Skip to content

Conversation

@olxandr
Copy link
Contributor

@olxandr olxandr commented Jul 19, 2025

Closes #1997

Description:

This PR is adding a native support for Couchbase.
The official github.com/couchbase/gocb/v2 Go Couchbase library is introduced as a dependency for this PR.

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

@coolwednesday coolwednesday changed the title [GoFr-SOC]: Couchbase support Couchbase support Jul 23, 2025
Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @olxandr ! A very well drafted PR. I would like you to also add docs with a docker container and a small code snippet. Refer how it is added for the others.

Other than that I would want you to also add screenshots of...... Logs Traces and metrics for a Db call. Would then test it in local and we will be good to go.

@olxandr
Copy link
Contributor Author

olxandr commented Jul 31, 2025

a docker container

What surprised me is that in order to get the Couchbase ready to use, just spinning up the docker container isn't enough. You also need to go to Couchbase Web Console by visiting http://localhost:8091 and manually setup the cluster. Here is the source.
Should i add this info somwhere too?

@coolwednesday
Copy link
Member

a docker container

What surprised me is that in order to get the Couchbase ready to use, just spinning up the docker container isn't enough. You also need to go to Couchbase Web Console by visiting http://localhost:8091 and manually setup the cluster. Here is the source. Should i add this info somwhere too?

You can add the respective docs link.

Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @olxandr !

A bit of info on the datasource setup in the docs would be appreciated.

@olxandr
Copy link
Contributor Author

olxandr commented Aug 1, 2025

also add screenshots of...... Logs Traces and metrics for a Db call.

Sure, here are the screenshots:

Logs:

2025-08-01T18:31:04,578609188+03:00

Trace:

2025-08-01T18:31:57,797531779+03:00

Error: pkg/gofr/container/mock_container.go:51:6: Function 'NewMockContainer' has too many statements (51 > 50) (funlen)

Not sure what i'm supposed to do with this failed check.

@Umang01-hash
Copy link
Member

@olxandr Please resolve the linter issues in your PR. Thankyou!

@olxandr
Copy link
Contributor Author

olxandr commented Aug 4, 2025

The NewMockContainer() inside pkg/gofr/container/mock_container.go has too many statements after adding Couchbase. So like i said:

Not sure what i'm supposed to do with this failed check.

Any suggestions on how to deal with it?
One approach is to breakdown the function into smaller, more focused helper functions. It is also possible to increase the funlen linter limit.

@olxandr olxandr requested a review from coolwednesday August 6, 2025 13:46
coolwednesday
coolwednesday previously approved these changes Aug 8, 2025
Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good to me.

This was referenced Aug 8, 2025
Umang01-hash
Umang01-hash previously approved these changes Aug 12, 2025
@Umang01-hash Umang01-hash dismissed stale reviews from coolwednesday and themself via afb14dc August 12, 2025 14:44
aryanmehrotra
aryanmehrotra previously approved these changes Aug 12, 2025
@Umang01-hash Umang01-hash merged commit 1dbe86d into gofr-dev:development Aug 12, 2025
14 checks passed
coolwednesday pushed a commit to coolwednesday/gofr that referenced this pull request Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Couchbase support

4 participants