postgres

package
v0.28.3 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README

MQTT - DB Schema

CREATE TABLE IF NOT EXISTS subscriptions (
    subtopic    VARCHAR(1024),
    group_id  	UUID,
    thing_id    UUID,
    client_id   VARCHAR(256),
    status      VARCHAR(128),
    created_at  FLOAT,
    PRIMARY KEY (client_id, subtopic, group_id, thing_id)
);

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(cfg Config) (*sqlx.DB, error)

Connect creates a connection to the PostgreSQL instance and applies any unapplied database migrations. A non-nil error is returned to indicate failure.

func NewRepository

func NewRepository(db dbutil.Database) mqtt.Repository

NewRepository instantiates a PostgreSQL implementation of mqt repository.

Types

type Config

type Config struct {
	Host        string
	Port        string
	User        string
	Pass        string
	Name        string
	SSLMode     string
	SSLCert     string
	SSLKey      string
	SSLRootCert string
}

Config defines the options that are used when connecting to a PostgreSQL instance

Jump to

Keyboard shortcuts

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