postgres

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package postgres provides low-level persistence implementations that store data in PostgreSQL database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJournalStoreSchema

func CreateJournalStoreSchema(
	ctx context.Context,
	db *sql.DB,
) error

CreateJournalStoreSchema creates the PostgreSQL schema elements required by JournalStore.

func CreateKeyValueStoreSchema

func CreateKeyValueStoreSchema(
	ctx context.Context,
	db *sql.DB,
) error

CreateKeyValueStoreSchema creates the PostgreSQL schema elements required by KeyValueStore.

Types

type JournalStore

type JournalStore struct {
	// DB is the PostgreSQL database connection.
	DB *sql.DB
}

JournalStore is an implementation of journal.Store that contains journals that persist records in a PostgresSQL table.

func (*JournalStore) Open

func (s *JournalStore) Open(_ context.Context, name string) (journal.Journal, error)

Open returns the journal with the given name.

type KeyValueStore

type KeyValueStore struct {
	DB *sql.DB
}

KeyValueStore is an implementation of kv.Store that stores keyspaces in a PostgreSQL database.

func (*KeyValueStore) Open

func (s *KeyValueStore) Open(_ context.Context, name string) (kv.Keyspace, error)

Open returns the keyspace with the given name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL