sqlstore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEntClient

func NewEntClient(sqlBackend string, connectionString string, opts ...ClientOption) (*ent.Client, error)

NewEntClient creates an ent client for use in the sqlmetadata store. Valid backends are MYSQL and PSQL.

Types

type ClientOption

type ClientOption func(*clientOptions)

func ClientWithConnMaxLifetime

func ClientWithConnMaxLifetime(connMaxLifetime time.Duration) ClientOption

Congiures a client with the specified max connection lifetime. Default is 3 minutes

func ClientWithMaxIdleConns

func ClientWithMaxIdleConns(maxIdleConns int) ClientOption

Configures a client with the specified max idle connections. Default is 10 connections

func ClientWithMaxOpenConns

func ClientWithMaxOpenConns(maxOpenConns int) ClientOption

Configures a client with the specified max open connections. Default is 100 connections

type Store

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

func New

func New(ctx context.Context, client *ent.Client) (*Store, <-chan error, error)

func (*Store) GetClient

func (s *Store) GetClient() *ent.Client

func (*Store) Store

func (s *Store) Store(ctx context.Context, gitoid string, obj []byte) error

Jump to

Keyboard shortcuts

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