Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
/ diplomat Public archive
forked from peburrows/diplomat

Elixir library for interacting with Google's Cloud Datastore

Notifications You must be signed in to change notification settings

interseller/diplomat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diplomat

Diplomat is an Elixir library for interacting with Google's Cloud Datastore.

Installation

  1. Add datastore to your list of dependencies in mix.exs:
def deps do
  [{:diplomat, "~> 0.2"}]
end
  1. Make sure you've configured Goth with your credentials:
config :goth,
  json: {:system, "GCP_CREDENTIALS_JSON"}

Usage

Insert an Entity:

Diplomat.Entity.new(
  %{"name" => "My awesome book", "author" => "Phil Burrows"},
  "Book",
  "my-unique-book-id"
) |> Diplomat.Entity.insert

Find an Entity via a GQL Query:

Diplomat.Query.new(
  "select * from `Book` where name = @name",
  %{name: "20,000 Leagues Under The Sea"}
) |> Diplomat.Query.execute

About

Elixir library for interacting with Google's Cloud Datastore

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 56.7%
  • Protocol Buffer 43.3%