Skip to main content

Built and signed on GitHub Actions

A set of APIs that allow interfacing to Google Datastore on GCP.

This package works with Bun, Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
100%
Published
2 months ago (0.3.0)

APIs for using Google Datastore from Deno.

Google Datastore is Firestore in Datastore under the hood these days, but has a more concise API and lacks the complex rule system that Firestore running in its native mode provides.

Users should create an instance of Datastore to connect to an instance of Google Datastore. Converting a datastore Entity to a JavaScript object can be done with entityToObject and a JavaScript object can be converted to an Entity via objectToEntity.

You can associate a datastore Key with a JavaScript object via the objectSetKey function. Any entities that were converted to objects with entityToObject will already have their key set, so can be mutated and then converted back to an entity and not lose their key.

Examples

Example 1

import { Datastore } from "jsr:@kitsonk/google-datastore";
import keys from "./service-account.json" with { type: "json" };

const datastore = new Datastore(keys);
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @kitsonk/google-datastore

Import symbol

import * as mod from "@kitsonk/google-datastore";

Add Package

npx jsr add @kitsonk/google-datastore

Import symbol

import * as mod from "@kitsonk/google-datastore";

Add Package

yarn dlx jsr add @kitsonk/google-datastore

Import symbol

import * as mod from "@kitsonk/google-datastore";

Add Package

pnpm dlx jsr add @kitsonk/google-datastore

Import symbol

import * as mod from "@kitsonk/google-datastore";

Add Package

bunx jsr add @kitsonk/google-datastore

Import symbol

import * as mod from "@kitsonk/google-datastore";