dbx

package
v0.0.0-...-2434619 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WrapErr = func(err *Error) error { return err }
	Logger  func(format string, args ...interface{})
)
View Source
var SQLite3JournalMode = "WAL"

SQLite3JournalMode controls the journal_mode pragma for all new connections. Since it is read without a mutex, it must be changed to the value you want before any Open calls.

Functions

func DeleteAll

func DeleteAll(ctx context.Context, db *DB) (int64, error)

Types

type ConfigValue_Row

type ConfigValue_Row struct {
	ConfigValue string
}

type DB

type DB struct {
	*sql.DB

	Hooks struct {
		Now func() time.Time
	}
	// contains filtered or unexported fields
}

func Open

func Open(driver, source string) (db *DB, err error)

func (*DB) Close

func (obj *DB) Close() (err error)

func (*DB) NewRx

func (obj *DB) NewRx() *Rx

func (*DB) Open

func (obj *DB) Open(ctx context.Context) (*Tx, error)

type DBMethods

type DBMethods interface {
	Methods

	Schema() string
	Rebind(sql string) string
}

type Error

type Error struct {
	Err         error
	Code        ErrorCode
	Driver      string
	Constraint  string
	QuerySuffix string
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode int
const (
	ErrorCode_Unknown ErrorCode = iota
	ErrorCode_UnsupportedDriver
	ErrorCode_NoRows
	ErrorCode_TxDone
	ErrorCode_TooManyRows
	ErrorCode_ConstraintViolation
	ErrorCode_EmptyUpdate
)

type GerritUser

type GerritUser struct {
	GerritUsername string
	ChatId         string
	LastReport     *time.Time
}

type GerritUser_ChatId_Field

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

func GerritUser_ChatId

func GerritUser_ChatId(v string) GerritUser_ChatId_Field

type GerritUser_Create_Fields

type GerritUser_Create_Fields struct {
	LastReport GerritUser_LastReport_Field
}

type GerritUser_GerritUsername_Field

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

func GerritUser_GerritUsername

func GerritUser_GerritUsername(v string) GerritUser_GerritUsername_Field

type GerritUser_LastReport_Field

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

func GerritUser_LastReport

func GerritUser_LastReport(v time.Time) GerritUser_LastReport_Field

func GerritUser_LastReport_Null

func GerritUser_LastReport_Null() GerritUser_LastReport_Field

func GerritUser_LastReport_Raw

func GerritUser_LastReport_Raw(v *time.Time) GerritUser_LastReport_Field

type GerritUser_Update_Fields

type GerritUser_Update_Fields struct {
	LastReport GerritUser_LastReport_Field
}

type InlineComment

type InlineComment struct {
	CommentId string
	UpdatedAt time.Time
}

type InlineComment_CommentId_Field

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

func InlineComment_CommentId

func InlineComment_CommentId(v string) InlineComment_CommentId_Field

type InlineComment_Update_Fields

type InlineComment_Update_Fields struct {
	UpdatedAt InlineComment_UpdatedAt_Field
}

type InlineComment_UpdatedAt_Field

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

func InlineComment_UpdatedAt

func InlineComment_UpdatedAt(v time.Time) InlineComment_UpdatedAt_Field

type MessageHandle_Row

type MessageHandle_Row struct {
	MessageHandle string
}

type Methods

type Methods interface {
	All_GerritUser_By_LastReport_Less(ctx context.Context,
		gerrit_user_last_report_less GerritUser_LastReport_Field) (
		rows []*GerritUser, err error)

	All_PatchsetAnnouncement_MessageHandle_By_ProjectName_And_ChangeNum_And_PatchsetNum(ctx context.Context,
		patchset_announcement_project_name PatchsetAnnouncement_ProjectName_Field,
		patchset_announcement_change_num PatchsetAnnouncement_ChangeNum_Field,
		patchset_announcement_patchset_num PatchsetAnnouncement_PatchsetNum_Field) (
		rows []*MessageHandle_Row, err error)

	All_TeamConfig(ctx context.Context) (
		rows []*TeamConfig, err error)

	CreateNoReturn_GerritUser(ctx context.Context,
		gerrit_user_gerrit_username GerritUser_GerritUsername_Field,
		gerrit_user_chat_id GerritUser_ChatId_Field,
		optional GerritUser_Create_Fields) (
		err error)

	CreateNoReturn_PatchsetAnnouncement(ctx context.Context,
		patchset_announcement_project_name PatchsetAnnouncement_ProjectName_Field,
		patchset_announcement_change_num PatchsetAnnouncement_ChangeNum_Field,
		patchset_announcement_patchset_num PatchsetAnnouncement_PatchsetNum_Field,
		patchset_announcement_message_handle PatchsetAnnouncement_MessageHandle_Field) (
		err error)

	CreateNoReturn_TeamConfig(ctx context.Context,
		team_config_config_key TeamConfig_ConfigKey_Field,
		team_config_config_value TeamConfig_ConfigValue_Field) (
		err error)

	Delete_InlineComment_By_UpdatedAt_Less(ctx context.Context,
		inline_comment_updated_at_less InlineComment_UpdatedAt_Field) (
		count int64, err error)

	Delete_PatchsetAnnouncement_By_Ts_Less(ctx context.Context,
		patchset_announcement_ts_less PatchsetAnnouncement_Ts_Field) (
		count int64, err error)

	Get_GerritUser_By_GerritUsername(ctx context.Context,
		gerrit_user_gerrit_username GerritUser_GerritUsername_Field) (
		gerrit_user *GerritUser, err error)

	Get_TeamConfig_ConfigValue_By_ConfigKey(ctx context.Context,
		team_config_config_key TeamConfig_ConfigKey_Field) (
		row *ConfigValue_Row, err error)

	UpdateNoReturn_GerritUser_By_GerritUsername(ctx context.Context,
		gerrit_user_gerrit_username GerritUser_GerritUsername_Field,
		update GerritUser_Update_Fields) (
		err error)

	UpdateNoReturn_TeamConfig_By_ConfigKey(ctx context.Context,
		team_config_config_key TeamConfig_ConfigKey_Field,
		update TeamConfig_Update_Fields) (
		err error)

	Update_InlineComment_By_CommentId(ctx context.Context,
		inline_comment_comment_id InlineComment_CommentId_Field,
		update InlineComment_Update_Fields) (
		inline_comment *InlineComment, err error)
}

type PatchsetAnnouncement

type PatchsetAnnouncement struct {
	Num           int
	ProjectName   string
	ChangeNum     int
	PatchsetNum   int
	MessageHandle string
	Ts            time.Time
}

type PatchsetAnnouncement_ChangeNum_Field

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

func PatchsetAnnouncement_ChangeNum

func PatchsetAnnouncement_ChangeNum(v int) PatchsetAnnouncement_ChangeNum_Field

type PatchsetAnnouncement_MessageHandle_Field

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

type PatchsetAnnouncement_Num_Field

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

func PatchsetAnnouncement_Num

func PatchsetAnnouncement_Num(v int) PatchsetAnnouncement_Num_Field

type PatchsetAnnouncement_PatchsetNum_Field

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

func PatchsetAnnouncement_PatchsetNum

func PatchsetAnnouncement_PatchsetNum(v int) PatchsetAnnouncement_PatchsetNum_Field

type PatchsetAnnouncement_ProjectName_Field

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

type PatchsetAnnouncement_Ts_Field

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

func PatchsetAnnouncement_Ts

func PatchsetAnnouncement_Ts(v time.Time) PatchsetAnnouncement_Ts_Field

type PatchsetAnnouncement_Update_Fields

type PatchsetAnnouncement_Update_Fields struct {
}

type Rx

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

func (*Rx) All_GerritUser_By_LastReport_Less

func (rx *Rx) All_GerritUser_By_LastReport_Less(ctx context.Context,
	gerrit_user_last_report_less GerritUser_LastReport_Field) (
	rows []*GerritUser, err error)

func (*Rx) All_PatchsetAnnouncement_MessageHandle_By_ProjectName_And_ChangeNum_And_PatchsetNum

func (rx *Rx) All_PatchsetAnnouncement_MessageHandle_By_ProjectName_And_ChangeNum_And_PatchsetNum(ctx context.Context,
	patchset_announcement_project_name PatchsetAnnouncement_ProjectName_Field,
	patchset_announcement_change_num PatchsetAnnouncement_ChangeNum_Field,
	patchset_announcement_patchset_num PatchsetAnnouncement_PatchsetNum_Field) (
	rows []*MessageHandle_Row, err error)

func (*Rx) All_TeamConfig

func (rx *Rx) All_TeamConfig(ctx context.Context) (
	rows []*TeamConfig, err error)

func (*Rx) Commit

func (rx *Rx) Commit() (err error)

func (*Rx) CreateNoReturn_GerritUser

func (rx *Rx) CreateNoReturn_GerritUser(ctx context.Context,
	gerrit_user_gerrit_username GerritUser_GerritUsername_Field,
	gerrit_user_chat_id GerritUser_ChatId_Field,
	optional GerritUser_Create_Fields) (
	err error)

func (*Rx) CreateNoReturn_PatchsetAnnouncement

func (rx *Rx) CreateNoReturn_PatchsetAnnouncement(ctx context.Context,
	patchset_announcement_project_name PatchsetAnnouncement_ProjectName_Field,
	patchset_announcement_change_num PatchsetAnnouncement_ChangeNum_Field,
	patchset_announcement_patchset_num PatchsetAnnouncement_PatchsetNum_Field,
	patchset_announcement_message_handle PatchsetAnnouncement_MessageHandle_Field) (
	err error)

func (*Rx) CreateNoReturn_TeamConfig

func (rx *Rx) CreateNoReturn_TeamConfig(ctx context.Context,
	team_config_config_key TeamConfig_ConfigKey_Field,
	team_config_config_value TeamConfig_ConfigValue_Field) (
	err error)

func (*Rx) Delete_InlineComment_By_UpdatedAt_Less

func (rx *Rx) Delete_InlineComment_By_UpdatedAt_Less(ctx context.Context,
	inline_comment_updated_at_less InlineComment_UpdatedAt_Field) (
	count int64, err error)

func (*Rx) Delete_PatchsetAnnouncement_By_Ts_Less

func (rx *Rx) Delete_PatchsetAnnouncement_By_Ts_Less(ctx context.Context,
	patchset_announcement_ts_less PatchsetAnnouncement_Ts_Field) (
	count int64, err error)

func (*Rx) Get_GerritUser_By_GerritUsername

func (rx *Rx) Get_GerritUser_By_GerritUsername(ctx context.Context,
	gerrit_user_gerrit_username GerritUser_GerritUsername_Field) (
	gerrit_user *GerritUser, err error)

func (*Rx) Get_TeamConfig_ConfigValue_By_ConfigKey

func (rx *Rx) Get_TeamConfig_ConfigValue_By_ConfigKey(ctx context.Context,
	team_config_config_key TeamConfig_ConfigKey_Field) (
	row *ConfigValue_Row, err error)

func (*Rx) Rebind

func (rx *Rx) Rebind(s string) string

func (*Rx) Rollback

func (rx *Rx) Rollback() (err error)

func (*Rx) UnsafeTx

func (rx *Rx) UnsafeTx(ctx context.Context) (unsafe_tx *sql.Tx, err error)

func (*Rx) UpdateNoReturn_GerritUser_By_GerritUsername

func (rx *Rx) UpdateNoReturn_GerritUser_By_GerritUsername(ctx context.Context,
	gerrit_user_gerrit_username GerritUser_GerritUsername_Field,
	update GerritUser_Update_Fields) (
	err error)

func (*Rx) UpdateNoReturn_TeamConfig_By_ConfigKey

func (rx *Rx) UpdateNoReturn_TeamConfig_By_ConfigKey(ctx context.Context,
	team_config_config_key TeamConfig_ConfigKey_Field,
	update TeamConfig_Update_Fields) (
	err error)

func (*Rx) Update_InlineComment_By_CommentId

func (rx *Rx) Update_InlineComment_By_CommentId(ctx context.Context,
	inline_comment_comment_id InlineComment_CommentId_Field,
	update InlineComment_Update_Fields) (
	inline_comment *InlineComment, err error)

type TeamConfig

type TeamConfig struct {
	ConfigKey   string
	ConfigValue string
}

type TeamConfig_ConfigKey_Field

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

func TeamConfig_ConfigKey

func TeamConfig_ConfigKey(v string) TeamConfig_ConfigKey_Field

type TeamConfig_ConfigValue_Field

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

func TeamConfig_ConfigValue

func TeamConfig_ConfigValue(v string) TeamConfig_ConfigValue_Field

type TeamConfig_Update_Fields

type TeamConfig_Update_Fields struct {
	ConfigValue TeamConfig_ConfigValue_Field
}

type Tx

type Tx struct {
	Tx *sql.Tx
	// contains filtered or unexported fields
}

type TxMethods

type TxMethods interface {
	Methods

	Rebind(s string) string
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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