Skip to content

A minimum expression repo for anyone who wants to give the EdgeDB Rust client a try.

Notifications You must be signed in to change notification settings

Dhghomon/edgedb_rust_client_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EdgeDB minimum expression repo

This repo contains a minimal EdgeDB setup with a schema based on the tutorial, and a few sample queries:

  • Simple scalar queries
  • Queries to return an Object and how to work with the Value enum
  • Query returning json to then deserialize into a Rust struct
  • Query using the Queryable derive macro, allowing deserializing into a Rust struct without needing intermediary json
  • Queries using arguments (e.g. $0, $1, etc.) requiring casts in EdgeDB and showing the relation between Rust and EdgeDB types

First clone the repo, then:

  • Make sure you have EdgeDB installed
  • Type edgedb project init and follow a few quick instructions. (Call the project example or whatever you like) You should have a running instance.
  • (Optional if curious: type edgedb instance list to see it and then type edgedb if you want to play around with the REPL a bit. (You can also type edgedb ui if you want to work through the UI) The schema hasn't been applied yet, so leave the REPL with \quit and:)
  • Type edgedb migration create. You should see a file called 00001.edgeql show up in the migrations folder. You don't need to do anything with this file - it's just a record of the instructions used to migrate the schema to its current state. (Very readable though so take a look if curious)
  • Type edgedb migrate to finish the migration.
  • Then just type cargo run and see the output.

About

A minimum expression repo for anyone who wants to give the EdgeDB Rust client a try.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages