Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

v1.2.0 - Featuring PostgreSQL support

Compare
Choose a tag to compare
@dstpierre dstpierre released this 19 Feb 11:53
· 270 commits to main since this release

This is certainly a major release, but since no breaking changes were introduced there's no reason to bump major version.

Introducing support for PostgreSQL

This release introduce the support to a completely new data store option using PostgreSQL.

In fact the default data store option in the docker-compose-demo.yml file uses PostgreSQL now.

You'll need to add an environment variable DATA_STORE to indicate which database engine you want StaticBackend to use.

DATA_STORE=pg 

or

DATA_STORE=mongo

By default, all collection names will be striped from their specific security model when creating PostgreSQL tables or MongoDB collection.

By default the security model allow all account users to read document and only the owner to write.

If you provide custom security model for a repository with reponame_770_ the table/collection name in the database will be reponame without the security indicator.

To continue to be backward compatible and leave the security indicator in the table/collection names you may use this environment variable:

KEEP_PERM_COL_NAME=yes

Atomic worker queue

We've added a simple work queue that guarantees only one worker will receive the job to be done.

Only available in our Go library at the moment.

Listening to work:

go backend.WorkerQueue(rootToken, "topic", function_to_call)

It's topic based, whenever you queue a job in a topic only one worker will receive it.

Queueing jobs:

err := backend.QueueWork(rootToken, "topic", "data as string")

The worker dequeue function:

func function_to_call(val string) {
  // do something with the value
  // no need to acknoledge
  // job is already removed from queue
}

The worker queue will be added soon to other server-side libraries.

As always, feedback and any help spreading the words always appreciated.

Also, contributing should start to be more easier now with all the tests coverage.