dbrepo

package
v0.0.0-...-2ed53ce Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateNewDeviceParams

type CreateNewDeviceParams struct {
	ProjectID        int32   `db:"project_id" json:"project_id"`
	Name             string  `db:"name" json:"name"`
	Description      *string `db:"description" json:"description"`
	ClientDeviceID   string  `db:"client_device_id" json:"client_device_id"`
	CustomAttributes []byte  `db:"custom_attributes" json:"custom_attributes"`
}

type CreateNewProjectsParams

type CreateNewProjectsParams struct {
	Name        string  `db:"name" json:"name"`
	Alias       string  `db:"alias" json:"alias"`
	Description *string `db:"description" json:"description"`
	Settings    []byte  `db:"settings" json:"settings"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Devices

type Devices struct {
	ID               int32     `db:"id" json:"id"`
	ProjectID        int32     `db:"project_id" json:"project_id"`
	Name             string    `db:"name" json:"name"`
	PhoneNumber      *string   `db:"phone_number" json:"phone_number"`
	Description      *string   `db:"description" json:"description"`
	IsActive         bool      `db:"is_active" json:"is_active"`
	CustomAttributes []byte    `db:"custom_attributes" json:"custom_attributes"`
	CreatedAt        time.Time `db:"created_at" json:"created_at"`
	UpdatedAt        time.Time `db:"updated_at" json:"updated_at"`
	Jid              *string   `db:"jid" json:"jid"`
	ClientDeviceID   string    `db:"client_device_id" json:"client_device_id"`
}

type GetDefaultProjectRow

type GetDefaultProjectRow struct {
	ID          int32   `db:"id" json:"id"`
	EncodedID   string  `db:"encoded_id" json:"encoded_id"`
	Name        string  `db:"name" json:"name"`
	Alias       string  `db:"alias" json:"alias"`
	Description *string `db:"description" json:"description"`
	Settings    []byte  `db:"settings" json:"settings"`
}

type GetDevicesByProjectEncodedIDRow

type GetDevicesByProjectEncodedIDRow struct {
	ID             int32   `db:"id" json:"id"`
	ClientDeviceID string  `db:"client_device_id" json:"client_device_id"`
	Name           string  `db:"name" json:"name"`
	PhoneNumber    *string `db:"phone_number" json:"phone_number"`
	Jid            *string `db:"jid" json:"jid"`
	Description    *string `db:"description" json:"description"`
	IsActive       bool    `db:"is_active" json:"is_active"`
}

type GetProjectByAliasRow

type GetProjectByAliasRow struct {
	ID    int32  `db:"id" json:"id"`
	Alias string `db:"alias" json:"alias"`
}

type GetProjectByEncodedIDRow

type GetProjectByEncodedIDRow struct {
	ID          int32   `db:"id" json:"id"`
	Name        string  `db:"name" json:"name"`
	Alias       string  `db:"alias" json:"alias"`
	Description *string `db:"description" json:"description"`
	Settings    []byte  `db:"settings" json:"settings"`
}

type GetProjectsRow

type GetProjectsRow struct {
	ID          int32   `db:"id" json:"id"`
	EncodedID   string  `db:"encoded_id" json:"encoded_id"`
	Name        string  `db:"name" json:"name"`
	Alias       string  `db:"alias" json:"alias"`
	Description *string `db:"description" json:"description"`
	Settings    []byte  `db:"settings" json:"settings"`
}

type Projects

type Projects struct {
	ID          int32     `db:"id" json:"id"`
	Name        string    `db:"name" json:"name"`
	Alias       string    `db:"alias" json:"alias"`
	Description *string   `db:"description" json:"description"`
	Settings    []byte    `db:"settings" json:"settings"`
	CreatedAt   time.Time `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time `db:"updated_at" json:"updated_at"`
}

type Querier

type Querier interface {
	CreateNewDevice(ctx context.Context, arg *CreateNewDeviceParams) (int32, error)
	CreateNewProjects(ctx context.Context, arg *CreateNewProjectsParams) (int32, error)
	GetDefaultProject(ctx context.Context) (*GetDefaultProjectRow, error)
	GetDevicesByProjectEncodedID(ctx context.Context, projectID int32) ([]*GetDevicesByProjectEncodedIDRow, error)
	GetProjectByAlias(ctx context.Context, alias string) (*GetProjectByAliasRow, error)
	GetProjectByEncodedID(ctx context.Context, dollar_1 string) (*GetProjectByEncodedIDRow, error)
	GetProjects(ctx context.Context) ([]*GetProjectsRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateNewDevice

func (q *Queries) CreateNewDevice(ctx context.Context, arg *CreateNewDeviceParams) (int32, error)

func (*Queries) CreateNewProjects

func (q *Queries) CreateNewProjects(ctx context.Context, arg *CreateNewProjectsParams) (int32, error)

func (*Queries) GetDefaultProject

func (q *Queries) GetDefaultProject(ctx context.Context) (*GetDefaultProjectRow, error)

func (*Queries) GetDevicesByProjectEncodedID

func (q *Queries) GetDevicesByProjectEncodedID(ctx context.Context, projectID int32) ([]*GetDevicesByProjectEncodedIDRow, error)

func (*Queries) GetProjectByAlias

func (q *Queries) GetProjectByAlias(ctx context.Context, alias string) (*GetProjectByAliasRow, error)

func (*Queries) GetProjectByEncodedID

func (q *Queries) GetProjectByEncodedID(ctx context.Context, dollar_1 string) (*GetProjectByEncodedIDRow, error)

func (*Queries) GetProjects

func (q *Queries) GetProjects(ctx context.Context) ([]*GetProjectsRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

Jump to

Keyboard shortcuts

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