Skip to content

Remove non public function definitions from DBAdapter type or create interface to require a close function for createCursor.  #384

Open
@lramirez925

Description

@lramirez925

Looking through the current implementation the DBAdapter createCursor function is never called by the service implementation which makes it feel like it is a private function that has leaked into the public interface.

Alternatively if this was created to allow for extended access to do more complicated queries/actions I can understand it being public. But then I feel it should have some kind of standardized return type. At minimum it should require close function to be part of the returned value so that actual cursor implementations are not left open. Those who don't return open connections can implement an empty close function. From what I have seen close is a pretty standard method for telling the object to no longer hold the connection/memory open.

Mongo package is one of those scenarios and the returned cursor appears to never gets close called on it once the values are retrieved from the MongoCursor object.

If the function is not meant to return a still open connection and the close is suppose to be done inside the cursor function can I suggest a name change? Cursors are normally understood to be a link to unretrieved data meaning the connection has remained open.

I only noticed this as I build my own adapter and I am having trouble understanding the uses for a lot of the "lower" functions as they seem to not be required by the DBService but still are publicly required to be on the DBAdapter implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions