Hey my name is Sascha.

On this website I will show you how I automate our e-commerce business.

DGraph - Part 3: RDF N-Quads

Adding or changing data is also called a mutation in Dgraph as in GraphQL. The input format here are so-called triples in the RDF N-Quad format. Such a triple consists of 3 components, a subjec , a predicate and a object. Something is ringing? Yes, exactly, there was something like that back in school a long time ago. The terms subject, predicate and object are not chosen at random here: A triple is a statement that relates subject and object to each other,

Dgraph - Part 2: GraphQL, Schema & first steps

Last time we started the server and saved our first data. For this we used Dgraph’s Ratel Interface. We also provided a GraphQl endpoint. Here we create the same data and connections as before in Ratel. At the moment we cannot do anything with our GraphQL endpoint because GraphQL needs a schema. For this we create a file called schema.graphql: 1 2 3 4 5 type Person { name: String! @id hometown: String friend_of: [Person] } The structure is the same as in part 1.

Dgraph - Part 1: installation & first steps

I was looking for a database system for an internal project in our company. For this reason, I looked at various systems. In addition to old acquaintances from the SQL or NoSQL environments, I came across something very interesting. Graph databases. Without wanting to go into great detail, here are the most interesting aspects for me and the reason I decided to choose a graph database for my project: no fixed database schema required data is represented in the form of nodes and connections strong focus on relationships between data sets precise retrieval of data even across relationships gRPC server built in GraphQL server built in Start Your Dgraph Server The easiest way to start Dgraph is with Docker.

Encode URLs in Go

The net/url package is a useful package for dealing with URLs, paths and parameters in Go. You can have parameters encoded in a URL or automatically convert special characters. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 package main import ( "fmt" "log" "net/url" ) func main() { //set the URL baseUrl, err := url.Parse("https://www.google.com/search") if err != nil { log.

Encrypt passwords with Go

Go already has many helpful packages from the start. One of them is the bcrypt package with which e.g. will encrypt passwords securely. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 package main import ( "fmt" "golang.org/x/crypto/bcrypt" ) func main() { pw := "SecretPassword" bs, err := bcrypt.GenerateFromPassword([]byte(pw), 2) //let's look at the encrypted password fmt.Printf("encryption result: %s\n", string(bs)) err = bcrypt.

Go routines and error handling

In a small project I am currently working on, I am dealing with the topic of error handling in goroutines. I have written a library here that offers different methods for orders. Of course, I took good care to ensure that an error is returned if the worst comes to the worst. But what is it like when I start a method as a goroutine? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 package main import ( "fmt" ) type order struct { id string } func (o order) create(id string) error { //do something useful with the order if id == "OD-002" { err := fmt.