db

package
v0.97.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package db manages database client and schema migrations to interact with entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

type ClientFactory interface {
	New() (Conn, error)
}

type Conn

type Conn struct {
	Client *ent.Client
	DB     *sql.DB
	Driver dialect.Driver
}

Conn holds database connection info

func Client

func Client(cfg *holos.Config) (Conn, error)

type MemoryClientFactory

type MemoryClientFactory struct {
	// contains filtered or unexported fields
}

MemoryClientFactory produces simple in-memory sqlite database clients for development and testing.

func NewMemoryClientFactory

func NewMemoryClientFactory(cfg *holos.Config) *MemoryClientFactory

NewMemoryClientFactory returns a MemoryClientFactory implementation of ClientFactory

func (*MemoryClientFactory) New

func (mc *MemoryClientFactory) New() (Conn, error)

type PGXClientFactory

type PGXClientFactory struct {
	// contains filtered or unexported fields
}

PGXClientFactory produces pgx clients suitable for live workloads

func NewPGXClientFactory

func NewPGXClientFactory(cfg *holos.Config) *PGXClientFactory

NewPGXClientFactory returns a PGXClientFactory implementation of ClientFactory

func (*PGXClientFactory) New

func (mc *PGXClientFactory) New() (Conn, error)

New returns a new ent.Client using pgx with PostgreSQL

Jump to

Keyboard shortcuts

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