persistence

package
v0.0.0-...-4d8659c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sqlite

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

Sqlite represents a SQLite database client

func NewSqliteDb

func NewSqliteDb() *Sqlite

NewSqliteDb initializes a new SQLite database connection and creates necessary tables if they do not exist

func (*Sqlite) CreateClient

func (db *Sqlite) CreateClient(c *models.Client) error

CreateClient inserts a new client into the database

func (*Sqlite) CreateUser

func (db *Sqlite) CreateUser(u *models.UserAccount) error

CreateUser inserts a new user into the database

func (*Sqlite) DeleteClient

func (db *Sqlite) DeleteClient(clientID string) error

DeleteClient removes a client from the database by their client ID

func (*Sqlite) DeleteUser

func (db *Sqlite) DeleteUser(userID string) error

DeleteUser removes a user from the database by their UUID

func (*Sqlite) GetClientById

func (db *Sqlite) GetClientById(clientId string) (*models.Client, error)

GetClientById retrieves a client from the database by their client ID

func (*Sqlite) GetClients

func (db *Sqlite) GetClients(offset, limit int) ([]*models.ClientOutput, error)

GetClients retrieves a list of clients from the database with pagination

func (*Sqlite) GetUserByEmail

func (db *Sqlite) GetUserByEmail(email string) (*models.UserAccount, error)

GetUserByEmail retrieves a user from the database by their email

func (*Sqlite) GetUserById

func (db *Sqlite) GetUserById(userId string) (*models.UserAccount, error)

GetUserById retrieves a user from the database by their UUID

func (*Sqlite) GetUsers

func (db *Sqlite) GetUsers(offset, limit int) ([]*models.UserAccountOutput, error)

GetUsers retrieves a list of users from the database with pagination

func (*Sqlite) UpdateClient

func (db *Sqlite) UpdateClient(c *models.Client) error

UpdateClient updates an existing client's information in the database

func (*Sqlite) UpdateUser

func (db *Sqlite) UpdateUser(u *models.UserAccount) error

UpdateUser updates an existing user's information in the database

Jump to

Keyboard shortcuts

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