Skip to content

qedus/appengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appengine

Build Status Coverage Status GoDoc

A reworked Go API for App Engine's datastore that allows plugging in of different backends for testing.

Update 15th July 2016

After using the datastore.Datastore interface for a few days I have come to the conclusion that this API should not be used. Passing around a datastore.Datastore object between functions is a pain as most code in practice also needs a context.Context object passed in as well. Retrofitting old code is also a pain because of this. In the end functions end up as follow:

func mutatorFunction(ctx context.Context, ds datastore.TransactionalDatastore, ...) error {
    // Use datastore.
}

Or saving the datastore.Datastore in a context:

func mutatorFunction(ctx context.Context, ...) error {
    ds, ok := datastore.FromContext(ctx)
    if !ok {
        return errors.New("datastore not available")
    }
    
    // Use datastore.
}

Stay tuned for an updated API, with the same in memory database functionality but hopefully much easier to use in practice.

About

A reworked Go API for App Engine's datastore that allows plugging in of different backends for testing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published