-
Notifications
You must be signed in to change notification settings - Fork 73
API Changelog
Jens Alfke edited this page May 1, 2019
·
9 revisions
- The Fleece function
FLJSON5_ToJSON
has added two more parameters, which return an error message and the position of the error in the input text.
- Added an error parameter to
c4doc_getExpiration
.
-
c4queryenum_seek
now allows arowIndex
of-1
. This seeks back to before the first row, returning the enumerator to the state it was when created. - Added
c4queryenum_restart
, which is just a synonym forc4queryenum_seek(e, -1)
. - Added
c4log_willLog
which quickly tells whether a given log domain and log level will produce output. Can be tested before a call toC4Log
if obtaining or formatting the parameters would be expensive. - Deprecated the
kC4DB_SharedKeys
flag -- it's now ignored, because databases now always use the shared-keys optimization.
These changes are not on the master branch yet!
-
Ref-counting changes:
- Added
c4db_release
, a better-named synonym ofc4db_free
. - C4Document, C4Query and C4QueryEnumerator are now ref-counted! Added
_retain
functions, and_release
as the preferred synonym for_free
.
- Added
-
Extra info:
- Added
c4db_setExtraInfo
,c4db_getExtraInfo
which let clients associate a pointer with a C4Database, such as their Database object. - Similarly, added an
extraInfo
field to C4Document. -
C4ExtraInfo
, declared in C4Base.h, is a simple struct containing avoid*
and a "destructor" callback that (if non-NULL) will be called when the owning database/document is freed.
- Added
-
C4Database changes:
- Added C4Database functions that map more closely to the CBL API:
c4db_openNamed
,c4db_copyNamed
,c4db_deleteNamed
. These all take a parent directory and database name (without extension/suffix.)
- Added C4Database functions that map more closely to the CBL API:
-
C4Document changes:
- Added
c4doc_containingValue
which takes aFLValue
and returns theC4Document
it belongs to. - Added
c4doc_generateID
for generating document UUIDs. - Added
c4doc_getSingleRevision
, a more efficient version ofc4doc_get
that loads only a single revision instead of the entire tree.
- Added
-
C4Query changes:
- Added
c4query_setParameters
. Parameter values can now be stored with a query as in the CBL API. Pass null parameters toc4query_run
to use the ones stored in the query. - Added
C4QueryObserver
. Adding an observer to a query makes it "live" as in CBL: the query will be run (in the background) with its stored parameter values, and the observer callback will be called with the enumerator when available. The query will re-run whenever the database changes, and the observer will be called every time the results change, until the observer is freed. The observer retains the query, so the client doesn't need to keep a reference to the query.
- Added
-
C4Blob changes:
- Added
c4stream_bytesWritten
, which returns the number of bytes written to the stream.
- Added