Concordant Client Library
Concordant client library (C-Client) for the Concordant platform.
Your app uses the C-Client library to access
the Concordant features: open a session to
connect to the platform; open a collection
and objects within the collection; run transactions to interact with the objects.
The Concordant platform automatically manages replication, synchronisation, persistence, and the offline/online mode switch.
The C-Client library is multiplatform: its
Kotlin code compiles to both JVM Bytecode
and JavaScript/TypeScript; packaged as a Maven package
and an
NPM package.
See how easy it is to use:
// Open a session
let session = client.Session.Companion.connect("mydatabase", "http://url-to-c-service", "credentials");
// Open a collection of objects
let collection = session.openCollection("mycollection", false);
// Open an object within the collection
let cntr = collection.open("mycounter", "PNCounter", false, function () {return});
// Compute with one or more objects within atomic transactions
this.props.session.transaction(client.utils.ConsistencyLevel.None, () => {
// Access objects here
cntr.increment(10);
let val = cntr.get();
});
This example starts by opening a session, in
order to use the database "mydatabase",
managed through the C-Service deployed at
URL "https://url-to-c-service", and using
the security credentials "credentials".
Then it opens the collection named
"mycollection", and the PNCounter object
named "mycounter" within "mycollection,"
both in write/read mode.
Finally, the application computes with the
counter, incrementing it by 10, and reading its value.
See also the
documentation page.