db_backend

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

* @Author: SpenserCai * @Date: 2023-08-31 00:44:10 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-04 12:38:53 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-31 00:33:12 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-31 00:44:44 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-31 00:08:39 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-31 11:50:00 * @Description: file content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbBackend

type DbBackend struct{}

func (DbBackend) CreateDbMysqlConnect

func (backend DbBackend) CreateDbMysqlConnect(dsn string) (*gorm.DB, error)

func (DbBackend) CreateDbSqliteConnect

func (backend DbBackend) CreateDbSqliteConnect(dsn string) (*gorm.DB, error)

type History added in v0.8.4

type History struct {
	MessageID   string `gorm:"column:message_id;size:100;index:idx_message;index:idx_message_id"`
	UserID      string `gorm:"column:user_id;size:100;index:idx_message"`
	CommandName string `gorm:"column:command_name;size:50"`
	OptionJson  string `gorm:"column:option_json;size:0"`
	Images      string `gorm:"column:images;size:0"`
	Created     string `gorm:"column:created;size:50"`
	Deleted     bool   `gorm:"column:deleted;default:false"`
}

func (History) TableName added in v0.8.4

func (History) TableName() string

type UserInfo

type UserInfo struct {
	ID           string `gorm:"column:id;primaryKey;size:100;index:idx_user,unique"`
	Name         string `gorm:"column:name;size:50"`
	Avatar       string `gorm:"column:avatar;size:0"`
	Created      string `gorm:"column:created;size:50"`
	Enable       bool   `gorm:"column:enable"`
	Roles        string `gorm:"column:roles;size:0"`
	StableConfig string `gorm:"column:stable_config;size:0"`
}

索引为id字段

func (UserInfo) TableName

func (UserInfo) TableName() string

Jump to

Keyboard shortcuts

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