CBLManager allOpenDatabases public?

22 views
Skip to first unread message

Todd Orler

unread,
Oct 20, 2014, 6:06:38 PM10/20/14
to mobile-c...@googlegroups.com

The allOpenDatabases property is declared in the "CBLManager+Internal.h" file.  However, its implementation is inside a "#pragma mark - DATABASES (PUBLIC API):" section.


I would like for this to be an official public API, but currently need to import "CBLManager+Internal.h".  Jens, can you make it so, by moving it to CBLManager.h.


Thanks,

-Todd

Jens Alfke

unread,
Oct 20, 2014, 7:57:54 PM10/20/14
to mobile-c...@googlegroups.com

> On Oct 20, 2014, at 3:06 PM, Todd Orler <jto...@gmail.com> wrote:
>
> The allOpenDatabases property is declared in the "CBLManager+Internal.h" file. However, its implementation is inside a "#pragma mark - DATABASES (PUBLIC API):" section.

I don't remember exactly … I suspect it used to be public API, but during the API review process we decided its behavior was kind of weird — it's not all the databases, it's just the ones that have been accessed since launch — and it wasn't important enough to keep in the API.

> I would like for this to be an official public API, but currently need to import "CBLManager+Internal.h".

If you need this functionality, can't you just keep track of which CBLDatabases you've accessed?

—Jens

Todd Orler

unread,
Oct 21, 2014, 12:47:43 PM10/21/14
to mobile-c...@googlegroups.com


On Monday, October 20, 2014 4:57:54 PM UTC-7, Jens Alfke wrote:

If you need this functionality, can't you just keep track of which CBLDatabases you've accessed?

It's possible, but much more convenient for us to just query the CBLManager.  We can have many databases open and being accessed over various components of our app.  In many cases, we currently get what we need from a particular database, and then let it go out of scope - i.e. we do not track the database.  For us to start tracking the databases we've accessed would be a duplication of effort, since the CBLManager already does this.

If you'll recall, we are the team that requested the public CBLDatabase "close" method, so that we could recover the memory allocated for specific databases we no longer needed access to.  CBLManager allOpenDatabases seems to compliment CBLDatabase close, so it would make sense (to us) for both of these to be public.

Thanks,
-Todd

Jens Alfke

unread,
Oct 21, 2014, 4:46:22 PM10/21/14
to mobile-c...@googlegroups.com

On Oct 21, 2014, at 9:47 AM, Todd Orler <jto...@gmail.com> wrote:

If you'll recall, we are the team that requested the public CBLDatabase "close" method, so that we could recover the memory allocated for specific databases we no longer needed access to.  CBLManager allOpenDatabases seems to compliment CBLDatabase close, so it would make sense (to us) for both of these to be public.

That's a good point. I've just filed an issue in our (internal) API tracker. We haven't had any formal API reviews in a while, but I'll ping the other devs and see what they think.

—Jens
Reply all
Reply to author
Forward
0 new messages