I’ve recently wrote a binding for the Deno runtime. The binding implementation is really simple and straightforward, and thanks to Deno’s built-in TypeScript support, you can just create a .ts
file anywhere on your machine, get full IDE autocomplete support, and easily write and run maintainable scripts for interacting with FoundationDB servers.
Here’s how simple it is to use:
import {
createDatabase,
selectAPIVersion,
startNetwork,
stopNetwork,
} from "https://deno.land/x/fdb/mod.ts";
selectAPIVersion(710);
startNetwork();
const database = createDatabase();
const transaction = database.createTransaction();
const future = transaction.get("some_key");
future.blockUntilReady();
future.getError();
const value = future.getValue();
if (value) {
console.log(value.byteLength);
} else {
console.log("Not found");
}
stopNetwork();
The source code is available here. Note that it is currently pretty much WIP and not stable, and I also plan to add higher level APIs to it in the future.