db

package
v0.0.0-...-2633ccd Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigPostgresqlV1

type ConfigPostgresqlV1 struct {
	Host     string `json:"host" validate:"required"`
	Port     int    `json:"port" validate:"required,min=1,max=65535"`
	User     string `json:"user" validate:"required"`
	Db       string `json:"db" validate:"required"`
	Password string `json:"password" validate:"required"`
}

структура для postgresql драйвера

type ConfigSqliteV1

type ConfigSqliteV1 struct {
	Path string `json:"path" validate:"required"`
}

структура для sqlite3 драйвера

func (*ConfigSqliteV1) Init

func (c *ConfigSqliteV1) Init(ctx context.Context) (*ent.Client, error)

инициализация sqlite3

type ConfigV1

type ConfigV1 struct {
	Sqlite     *ConfigSqliteV1     `json:"sqlite" validate:"omitempty"`
	Postgresql *ConfigPostgresqlV1 `json:"postgresql" validate:"omitempty"`
}

стркуктура для кофигурации БД

func (ConfigV1) Init

func (c ConfigV1) Init(ctx context.Context) (*ent.Client, error)

инициализация БД в зависимости от конфига

Jump to

Keyboard shortcuts

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