schema

package
v0.0.0-...-af5bed0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(ctx context.Context, conn *pgx.Conn, b sqlbuilder.SelectBuilder) (int64, error)

func Delete

func Delete[T any]() (db *sqlbuilder.DeleteBuilder)

func Exec

func Exec(ctx context.Context, conn *pgx.Conn, b sqlbuilder.Builder) (int64, error)

func For

func For[T any]() *sqlbuilder.Struct

func Insert

func Insert[T any](rows ...T) (ib *sqlbuilder.InsertBuilder)

func Of

func Of[T any](t T) *sqlbuilder.Struct

func QueryAll

func QueryAll[T any](ctx context.Context, conn *pgx.Conn, b sqlbuilder.Builder) (rows []T, err error)

func QueryFirst

func QueryFirst[T any](ctx context.Context, conn *pgx.Conn, b sqlbuilder.Builder) (row T, err error)

func QueryOne

func QueryOne[T any](ctx context.Context, conn *pgx.Conn, b sqlbuilder.Builder) (row T, err error)

func Select

func Select[T any]() (sb *sqlbuilder.SelectBuilder)

func TableName

func TableName[T any]() string

func Update

func Update[T any]() (ub *sqlbuilder.UpdateBuilder)

Types

type Account

type Account struct {
	ID         uuid.UUID  `db:"id"`
	InstanceID uuid.UUID  `db:"instance_id"`
	CreatedAt  time.Time  `db:"created_at"`
	DeletedAt  *time.Time `db:"deleted_at"`
}

type AccountAuthorization

type AccountAuthorization struct {
	AccountID    uuid.UUID `db:"account_id"`
	Username     *string   `db:"username"`
	Email        *string   `db:"email"`
	PasswordHash string    `db:"password_hash"`
	TOTPKey      *string   `db:"totp_key"`
}

type AccountBlock

type AccountBlock struct {
	AccountID uuid.UUID `db:"account_id"`
	BlockedID uuid.UUID `db:"blocked_id"`
	CreatedAt time.Time `db:"created_at"`
}

type AccountConfiguration

type AccountConfiguration struct {
	AccountID          uuid.UUID `db:"account_id"`
	AllowPasswordReset bool      `db:"allow_password_reset"`
}

type AccountInstanceBlock

type AccountInstanceBlock struct {
	AccountID uuid.UUID `db:"account_id"`
	BlockedID uuid.UUID `db:"field_blocked_id"`
	CreatedAt time.Time `db:"created_at"`
}

type AccountSession

type AccountSession struct {
	ID        uuid.UUID `db:"id"`
	AccountID uuid.UUID `db:"account_id"`
	CreatedAt time.Time `db:"created_at"`
	ExpiresAt time.Time `db:"expires_at"`
}

type Announcement

type Announcement struct {
	PostID uuid.UUID `db:"post_id"`
}

type Color

type Color color.RGBA

func (Color) MarshalJSON

func (c Color) MarshalJSON() ([]byte, error)

func (*Color) Scan

func (c *Color) Scan(value driver.Value) error

func (*Color) UnmarshalJSON

func (c *Color) UnmarshalJSON(raw []byte) error

func (Color) Value

func (c Color) Value() (driver.Value, error)

type CustomEmoji

type CustomEmoji struct {
	ID        uuid.UUID     `db:"id"`
	Name      string        `db:"name"`
	Unlisted  bool          `db:"unlisted"`
	FileID    uuid.UUID     `db:"file_id"`
	GroupID   uuid.NullUUID `db:"group_id"`
	CreatedAt time.Time     `db:"created_at"`
	DeletedAt *time.Time    `db:"deleted_at"`
}

type Emoji

type Emoji struct {
	ID        uuid.UUID     `db:"id"`
	Name      string        `db:"name"`
	Unlisted  bool          `db:"unlisted"`
	FileID    uuid.NullUUID `db:"file_id"`
	GroupID   uuid.NullUUID `db:"group_id"`
	CreatedAt time.Time     `db:"created_at"`
	DeletedAt *time.Time    `db:"deleted_at"`
}

type EmojiAlias

type EmojiAlias struct {
	EmojiID uuid.UUID `db:"emoji_id"`
	Alias   string    `db:"alias"`
}

type EmojiTag

type EmojiTag struct {
	EmojiID uuid.UUID `db:"emoji_id"`
	Name    string    `db:"name"`
}

type FederationConfiguration

type FederationConfiguration struct {
	InstanceID         uuid.UUID `db:"instance_id"`
	RestrictFederation bool      `db:"restrict_federation"`
}

type File

type File struct {
	ID        uuid.UUID `db:"id"`
	AccountID uuid.UUID `db:"account_id"`
	URL       string    `db:"url"`
	MIMEType  string    `db:"mimetype"`
	Size      uint      `db:"size"`
	SHA256    string    `db:"sha256"`
	CreatedAt time.Time `db:"created_at"`
}

type FileReport

type FileReport struct {
	ID              uuid.UUID     `db:"id"`
	FileID          uuid.UUID     `db:"file_id"`
	ReporterID      uuid.UUID     `db:"reporter_id"`
	Content         string        `db:"content"`
	GroupReportID   uuid.NullUUID `db:"group_report_id"`
	ProfileReportID uuid.NullUUID `db:"profile_report_id"`
	PostReportID    uuid.NullUUID `db:"post_report_id"`
	CreatedAt       time.Time     `db:"created_at"`
}

type FileRevision

type FileRevision struct {
	FileID    uuid.UUID `db:"file_id"`
	Version   uint      `db:"version"`
	Subject   *string   `db:"subject"`
	AltText   *string   `db:"alt_text"`
	CreatedAt time.Time `db:"created_at"`
}

type Filter

type Filter struct {
	ID        uuid.UUID `db:"id"`
	AccountID uuid.UUID `db:"account_id"`
	Name      string    `db:"name"`
	CreatedAt time.Time `db:"created_at"`
}

type FilterKeyword

type FilterKeyword struct {
	FilterID uuid.UUID `db:"filter_id"`
	Keyword  string    `db:"keyword"`
	Regexp   bool      `db:"regexp"`
}

type Group

type Group struct {
	ID               uuid.UUID     `db:"id"`
	InstanceID       uuid.UUID     `db:"instance_id"`
	Name             string        `db:"name"`
	DisplayName      string        `db:"display_name"`
	Description      string        `db:"description"`
	AvatarFileID     uuid.NullUUID `db:"avatar_file_id"`
	HeaderFileID     uuid.NullUUID `db:"header_file_id"`
	BackgroundFileID uuid.NullUUID `db:"background_file_id"`
	AccentColor      *Color        `db:"accent_color"`
	Private          bool          `db:"private"`
	CreatedAt        time.Time     `db:"created_at"`
}

type GroupAdmin

type GroupAdmin struct {
	GroupID   uuid.UUID `db:"group_id"`
	ProfileID uuid.UUID `db:"profile_id"`
	Owner     bool      `db:"owner"`
	CreatedAt time.Time `db:"created_at"`
}

type GroupBan

type GroupBan struct {
	GroupID   uuid.UUID     `db:"group_id"`
	BannedID  uuid.UUID     `db:"banned_id"`
	AdminID   uuid.NullUUID `db:"admin_id"`
	Reason    string        `db:"reason"`
	CreatedAt time.Time     `db:"created_at"`
}

type GroupConfiguration

type GroupConfiguration struct {
	GroupID       uuid.UUID      `db:"group_id"`
	ShowMembers   SettingTernary `db:"show_members"`
	AutoAccept    bool           `db:"auto_accept"`
	AllowRequests bool           `db:"allow_requests"`
	AllowInvites  bool           `db:"allow_invites"`
}

type GroupMember

type GroupMember struct {
	GroupID   uuid.UUID `db:"group_id"`
	MemberID  uuid.UUID `db:"member_id"`
	CreatedAt time.Time `db:"created_at"`
}

type GroupMemberInvite

type GroupMemberInvite struct {
	GroupID   uuid.UUID `db:"group_id"`
	MemberID  uuid.UUID `db:"member_id"`
	ProfileID uuid.UUID `db:"profile_id"`
	CreatedAt time.Time `db:"created_at"`
}

type GroupMemberRequest

type GroupMemberRequest struct {
	GroupID   uuid.UUID `db:"group_id"`
	ProfileID uuid.UUID `db:"profile_id"`
	CreatedAt time.Time `db:"created_at"`
}

type GroupReport

type GroupReport struct {
	ID         uuid.UUID `db:"id"`
	GroupID    uuid.UUID `db:"group_id"`
	ReporterID uuid.UUID `db:"reporter_id"`
	Content    string    `db:"content"`
	CreatedAt  time.Time `db:"created_at"`
}

type Instance

type Instance struct {
	ID        uuid.UUID  `db:"id"`
	Host      string     `db:"host"`
	Remote    bool       `db:"remote"`
	CreatedAt time.Time  `db:"created_at"`
	DeletedAt *time.Time `db:"deleted_at"`
}

type InstanceAdmin

type InstanceAdmin struct {
	InstanceID uuid.UUID `db:"instance_id"`
	AccountID  uuid.UUID `db:"account_id"`
}

type InstanceBlock

type InstanceBlock struct {
	InstanceID   uuid.UUID `db:"instance_id"`
	RejectMedia  bool      `db:"reject_media"`
	RejectEvents bool      `db:"reject_events"`
	CreatedAt    time.Time `db:"created_at"`
}

type InstanceProfile

type InstanceProfile struct {
	InstanceID  uuid.UUID `db:"instance_id"`
	DisplayName string    `db:"display_name"`
	Description string    `db:"description"`
}

type InstanceReport

type InstanceReport struct {
	ID         uuid.UUID `db:"id"`
	InstanceID uuid.UUID `db:"instance_id"`
	ReporterID uuid.UUID `db:"reporter_id"`
	Content    string    `db:"content"`
	CreatedAt  time.Time `db:"created_at"`
}

type LimitsConfiguration

type LimitsConfiguration struct {
	InstanceID uuid.UUID `db:"instance_id"`

	Accounts struct {
		ProfilesLimit uint `db:"profiles_limit"`
	} `db:"accounts"`

	Profiles struct {
		NameCharacterLimit        uint `db:"name_character_limit"`
		DisplayNameCharacterLimit uint `db:"display_name_character_limit"`
		DescriptionCharacterLimit uint `db:"description_character_limit"`
		TimelinesLimit            uint `db:"timelines_limit"`
	} `db:"profiles"`

	Groups struct {
		NameCharacterLimit        uint `db:"name_character_limit"`
		DisplayNameCharacterLimit uint `db:"display_name_character_limit"`
		DescriptionCharacterLimit uint `db:"description_character_limit"`
	} `db:"groups"`

	Posts struct {
		CharacterLimit   uint `db:"character_limit"`
		AttachmentsLimit uint `db:"attachments_limit"`
		PollsLimit       uint `db:"polls_limit"`
	} `db:"posts"`

	Poll struct {
		OptionsLimit         uint `db:"options_limit"`
		OptionCharacterLimit uint `db:"option_character_limit"`
	} `db:"polls"`

	Filters struct {
		KeywordsLimit         uint `db:"keywords_limit"`
		KeywordCharacterLimit uint `db:"keyword_character_limit"`
	} `db:"filters"`
}

type Poll

type Poll struct {
	ID                 uuid.UUID  `db:"id"`
	ProfileID          uuid.UUID  `db:"profile_id"`
	MaximumVoteCount   *uint      `db:"allow_multiple_votes"`
	AllowCustomOptions bool       `db:"allow_custom_options"`
	CreatedAt          time.Time  `db:"created_at"`
	ExpiresAt          *time.Time `db:"expires_at"`
}

type PollOption

type PollOption struct {
	ID        uuid.UUID `db:"id"`
	Order     uint      `db:"order" fieldopt:"withquote"`
	CreatedAt time.Time `db:"created_at"`
}

type PollOptionRevision

type PollOptionRevision struct {
	OptionID  uuid.UUID `db:"option_id"`
	Version   uint      `db:"version"`
	Content   string    `db:"content"`
	CreatedAt time.Time `db:"created_at"`
}

type PollVote

type PollVote struct {
	ProfileID     uuid.UUID `db:"profile_id"`
	OptionID      uuid.UUID `db:"option_id"`
	OptionVersion uint      `db:"option_version"`
	CreatedAt     time.Time `db:"created_at"`
}

type Post

type Post struct {
	ID        uuid.UUID  `db:"id"`
	ProfileID uuid.UUID  `db:"profile_id"`
	ReplyToID uuid.UUID  `db:"reply_to_id"`
	GroupID   uuid.UUID  `db:"group_id"`
	CreatedAt time.Time  `db:"created_at"`
	DeletedAt *time.Time `db:"deleted_at"`
}

type PostAttachment

type PostAttachment struct {
	PostID      uuid.UUID `db:"post_id"`
	PostVersion uint      `db:"post_version"`
	FileID      uuid.UUID `db:"file_id"`
	Order       uint      `db:"order" fieldopt:"withquote"`
}

type PostFavorite

type PostFavorite struct {
	PostID    uuid.UUID `db:"post_id"`
	ProfileID uuid.UUID `db:"profile_id"`
}

type PostGroupTag

type PostGroupTag struct {
	PostID  uuid.UUID `db:"post_id"`
	GroupID uuid.UUID `db:"group_id"`
}

type PostPoll

type PostPoll struct {
	PostID      uuid.UUID `db:"post_id"`
	PostVersion uint      `db:"post_version"`
	PollID      uuid.UUID `db:"poll_id"`
}

type PostReaction

type PostReaction struct {
	PostID    uuid.UUID `db:"post_id"`
	ProfileID uuid.UUID `db:"profile_id"`
	EmojiID   uuid.UUID `db:"emoji_id"`
}

type PostReport

type PostReport struct {
	ID         uuid.UUID `db:"id"`
	PostID     uuid.UUID `db:"post_id"`
	ReporterID uuid.UUID `db:"reporter_id"`
	Content    string    `db:"content"`
	CreatedAt  time.Time `db:"created_at"`
}

type PostRevision

type PostRevision struct {
	PostID    uuid.UUID `db:"post_id"`
	Version   uint      `db:"version"`
	Subject   *string   `db:"subject"`
	Content   string    `db:"content"`
	CreatedAt time.Time `db:"created_at"`
}

type PostSchedule

type PostSchedule struct {
	PostID    uuid.UUID  `db:"post_id"`
	PublishAt *time.Time `db:"publish_at"`
	DeleteAt  *time.Time `db:"delete_at"`
}

type PostTag

type PostTag struct {
	PostID      uuid.UUID `db:"post_id"`
	PostVersion uint      `db:"post_version"`
	Tag         string    `db:"tag"`
	Order       uint      `db:"order" fieldopt:"withquote"`
}

type PostWithContent

type PostWithContent struct {
	ID        uuid.UUID     `db:"id"`
	Version   uint          `db:"version"`
	ProfileID uuid.UUID     `db:"profile_id"`
	ReplyToID uuid.NullUUID `db:"reply_to_id"`
	GroupID   uuid.NullUUID `db:"group_id"`
	Subject   *string       `db:"subject"`
	Content   string        `db:"content"`
	CreatedAt time.Time     `db:"created_at"`
	UpdatedAt time.Time     `db:"updated_at"`
}

type Profile

type Profile struct {
	ID               uuid.UUID     `db:"id"`
	AccountID        uuid.UUID     `db:"account_id"`
	Name             *string       `db:"name"`
	DisplayName      *string       `db:"display_name"`
	Description      *string       `db:"description"`
	AvatarFileID     uuid.NullUUID `db:"avatar_file_id"`
	HeaderFileID     uuid.NullUUID `db:"header_file_id"`
	BackgroundFileID uuid.NullUUID `db:"background_file_id"`
	AccentColor      *Color        `db:"accent_color"`
	CreatedAt        time.Time     `db:"created_at"`
	DeletedAt        *time.Time    `db:"deleted_at"`
}

type ProfileConfiguration

type ProfileConfiguration struct {
	ProfileID          uuid.UUID      `db:"profile_id"`
	ConnectionRequests SettingTernary `db:"connection_requests"`
	ShowConnections    SettingTernary `db:"show_connections"`
	SharePostHistory   SettingTernary `db:"share_post_history"`
}

type ProfileConnection

type ProfileConnection struct {
	Profile1ID uuid.UUID `db:"profile_1_id"`
	Profile2ID uuid.UUID `db:"profile_2_id"`
	CreatedAt  time.Time `db:"created_at"`
}

type ProfileConnectionRequest

type ProfileConnectionRequest struct {
	ProfileID   uuid.UUID `db:"profile_id"`
	RequesterID uuid.UUID `db:"requester_id"`
	CreatedAt   time.Time `db:"created_at"`
}

type ProfileField

type ProfileField struct {
	ProfileID uuid.UUID `db:"profile_id"`
	Key       string    `db:"key"`
	Value     string    `db:"value"`
	Order     uint      `db:"order" fieldopt:"withquote"`
}

type ProfileFilter

type ProfileFilter struct {
	ProfileID uuid.UUID `db:"profile_id"`
	FilterID  uuid.UUID `db:"filter_id"`
	Enable    bool      `db:"enable"`
}

type ProfileGroupConfiguration

type ProfileGroupConfiguration struct {
	ProfileID          uuid.UUID      `db:"profile_id"`
	GroupID            uuid.UUID      `db:"group_id"`
	ConnectionRequests SettingTernary `db:"connection_requests"`
	ShowConnections    SettingTernary `db:"show_connections"`
	SharePostHistory   SettingTernary `db:"share_post_history"`
}

type ProfileInstanceMute

type ProfileInstanceMute struct {
	ProfileID uuid.UUID  `db:"profile_id"`
	MutedID   uuid.UUID  `db:"muted_id"`
	CreatedAt time.Time  `db:"created_at"`
	DeleteAt  *time.Time `db:"delete_at"`
}

type ProfileMute

type ProfileMute struct {
	ProfileID uuid.UUID  `db:"profile_id"`
	MutedID   uuid.UUID  `db:"muted_id"`
	CreatedAt time.Time  `db:"created_at"`
	DeleteAt  *time.Time `db:"delete_at"`
}

type ProfileReport

type ProfileReport struct {
	ID         uuid.UUID `db:"id"`
	ProfileID  uuid.UUID `db:"profile_id"`
	ReporterID uuid.UUID `db:"reporter_id"`
	Content    string    `db:"content"`
	CreatedAt  time.Time `db:"created_at"`
}

type RegistrationConfiguration

type RegistrationConfiguration struct {
	InstanceID        uuid.UUID      `db:"instance_id"`
	AllowRegistration SettingTernary `db:"allow_registration"`
}

type SettingTernary

type SettingTernary string
const (
	SettingEnabled  SettingTernary = "enabled"
	SettingPartial  SettingTernary = "partial"
	SettingDisabled SettingTernary = "disabled"
)

func (*SettingTernary) Scan

func (ternary *SettingTernary) Scan(value any) error

func (SettingTernary) Valid

func (ternary SettingTernary) Valid() bool

func (SettingTernary) Value

func (ternary SettingTernary) Value() (driver.Value, error)

type Timeline

type Timeline struct {
	ID        uuid.UUID `db:"id"`
	ProfileID uuid.UUID `db:"profile_id"`
	Name      string    `db:"name"`
	Order     uint      `db:"order" fieldopt:"withquote"`
	CreatedAt time.Time `db:"created_at"`
}

type TimelineConfiguration

type TimelineConfiguration struct {
	TimelineID      uuid.UUID `db:"timeline_id"`
	AutoAddProfiles bool      `db:"auto_add_profiles"`
	AutoAddGroups   bool      `db:"auto_add_groups"`
}

type TimelineFilter

type TimelineFilter struct {
	TimelineID uuid.UUID `db:"timeline_id"`
	FilterID   uuid.UUID `db:"filter_id"`
	Enable     bool      `db:"enable"`
}

type TimelineGroup

type TimelineGroup struct {
	TimelineID uuid.UUID `db:"timeline_id"`
	GroupID    uuid.UUID `db:"group_id"`
}

type TimelinePost

type TimelinePost struct {
	TimelineID uuid.UUID `db:"timeline_id"`
	PostID     uuid.UUID `db:"post_id"`
}

type TimelineProfile

type TimelineProfile struct {
	TimelineID uuid.UUID `db:"timeline_id"`
	ProfileID  uuid.UUID `db:"profile_id"`
}

Jump to

Keyboard shortcuts

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