import {
createDatabase,
selectAPIVersion,
startNetwork,
stopNetwork,
} from "https://deno.land/x/fdb/mod.ts";
selectAPIVersion(710);
startNetwork();
const database = createDatabase();
const transaction = database.openTenant("yourTenant").createTransaction();
const future = transaction.get("yourKey");
future.blockUntilReady(); // or `future.setCallback`
future.getError(); // throws if the future has error
const value = future.getValue();
if (value == null) {
console.log("Key not found");
} else {
const string = new TextDecoder().decode(new Uint8Array(value));
console.log(`yourKey is ${string}`);
}
stopNetwork();
-
Notifications
You must be signed in to change notification settings - Fork 1
FoundationDB for Deno
License
rojvv/foundationdb_deno
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
FoundationDB for Deno
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published