Documentation ¶
Index ¶
- type Sqlite
- func (db *Sqlite) CreateClient(c *models.Client) error
- func (db *Sqlite) CreateUser(u *models.UserAccount) error
- func (db *Sqlite) DeleteClient(clientID string) error
- func (db *Sqlite) DeleteUser(userID string) error
- func (db *Sqlite) GetClientById(clientId string) (*models.Client, error)
- func (db *Sqlite) GetClients(offset, limit int) ([]*models.ClientOutput, error)
- func (db *Sqlite) GetUserByEmail(email string) (*models.UserAccount, error)
- func (db *Sqlite) GetUserById(userId string) (*models.UserAccount, error)
- func (db *Sqlite) GetUsers(offset, limit int) ([]*models.UserAccountOutput, error)
- func (db *Sqlite) UpdateClient(c *models.Client) error
- func (db *Sqlite) UpdateUser(u *models.UserAccount) error
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 ¶
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 ¶
DeleteClient removes a client from the database by their client ID
func (*Sqlite) DeleteUser ¶
DeleteUser removes a user from the database by their UUID
func (*Sqlite) GetClientById ¶
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 ¶
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