Skip to content

Conversation

@cabljac
Copy link
Contributor

@cabljac cabljac commented Aug 16, 2024

This PR adds a firestore retriever helper to the Go plugin

(Merge #790 first)

Resolves #711

Checklist (if applicable):

  • Tested (manually, unit tested, etc.)
  • Changelog updated
  • Docs updated
@cabljac cabljac mentioned this pull request Aug 16, 2024
3 tasks
@cabljac cabljac changed the base branch from main to next August 30, 2024 08:29
@cabljac cabljac changed the title feat(go): add firestore retriever to go firebase plugin Aug 30, 2024
@pavelgj pavelgj requested review from apascal07, jba and ssbushi August 30, 2024 12:57
t.Error("retrieved document is nil")
}
}
fmt.Printf("Doc with content \n\n %s \n\n retrieved \n\n", resp.Documents[0].Content[0].Text)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused: where does this test add documents to the collection?

Anyway, assuming you know the documents, you can do a little better here by checking their content, or at least part of their content (like a substring).

Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't see where the documents come from. If they have to be present in the DB already, add a comment explaining that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup! will sort this out, applying these changes when I can in between some js work


coll := cfg.Client.Collection(cfg.Collection)
if coll == nil {
return nil, fmt.Errorf("collection path is invalid")
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt.Errorf("DefineFirestoreRetriever: collection path %q is invalid", cfg.Collection)

Also I wonder if we could call this outside the closure to check the error earlier.

t.Error("retrieved document is nil")
}
}
fmt.Printf("Doc with content \n\n %s \n\n retrieved \n\n", resp.Documents[0].Content[0].Text)
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't see where the documents come from. If they have to be present in the DB already, add a comment explaining that.

@cabljac cabljac force-pushed the @invertase/firestore-retriever-go branch 4 times, most recently from 521a059 to 32c9d3c Compare September 26, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants