function

Open

func Open( ctx context.Context, databaseURL string, ) (*Store, error)

Open the PostgreSQL store with bounded default pool settings.

Source adapters/postgres/postgres.go:63

@param ctx
Connection context.
@param databaseURL
PostgreSQL connection URL.
@returns
The store or a configuration/connection error.

Example

go
backend, err := postgres.Open(ctx, os.Getenv("DATABASE_URL"))
if err != nil {
  return err
}
defer backend.Close()

Related types

  • Store

    A PostgreSQL implementation of Ridu’s document, snapshot, auth, preference, task, job, lock, upload-reference, and migration store contracts.