{"modulePath":"github.com/twitchdev/twitch-cli","version":"v1.1.25","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package database\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reseved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0\n\n## Constants\n\n```go\nconst BAN_ADD = \"moderation.user.ban\"\n```\n\n```go\nconst BAN_REMOVE = \"moderation.user.unban\"\n```\n\n```go\nconst MOD_ADD = \"moderation.moderator.add\"\n```\n\n```go\nconst MOD_REMOVE = \"moderation.moderator.remove\"\n```\n\n```go\nconst SEP_AND = \"and\"\n```\n\n```go\nconst SEP_OR = \"or\"\n```\n\n## Types\n\n```go\ntype AuthenticationClient struct {\n\tID          string `db:\"id\"`\n\tSecret      string `db:\"secret\"`\n\tName        string `db:\"name\"`\n\tIsExtension bool   `db:\"is_extension\"`\n}\n```\n\n```go\ntype Authorization struct {\n\tID        int    `db:\"id\" dbi:\"false\"`\n\tClientID  string `db:\"client_id\"`\n\tUserID    string `db:\"user_id\"`\n\tToken     string `db:\"token\"`\n\tExpiresAt string `db:\"expires_at\"`\n\tScopes    string `db:\"scopes\"`\n}\n```\n\n```go\ntype Ban struct {\n\tUserID             string  `db:\"user_id\" json:\"user_id\"`\n\tUserLogin          string  `db:\"user_login\" json:\"user_login\"`\n\tUserName           string  `db:\"user_name\" json:\"user_name\"`\n\tExpiresAt          *string `db:\"expires_at\" json:\"expires_at\"`\n\tCreatedAt          string  `db:\"created_at\" json:\"created_at\"`\n\tReason             string  `json:\"reason\"`\n\tModeratorID        string  `json:\"moderator_id\"`\n\tModeratorUserLogin string  `json:\"moderator_login\"`\n\tModeratorUserName  string  `json:\"moderator_name\"`\n}\n```\n\n```go\ntype BanActionEvent struct {\n\tBroadcasterID      string  `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tBroadcasterLogin   string  `db:\"broadcaster_login\" json:\"broadcaster_login\"`\n\tBroadcasterName    string  `db:\"broadcaster_name\" json:\"broadcaster_name\"`\n\tUserID             string  `db:\"user_id\" json:\"user_id\"`\n\tUserLogin          string  `db:\"user_login\" json:\"user_login\"`\n\tUserName           string  `db:\"user_name\" json:\"user_name\"`\n\tExpiresAt          *string `db:\"expires_at\" json:\"expires_at\"`\n\tReason             string  `json:\"reason\"`\n\tModeratorID        string  `json:\"moderator_id\"`\n\tModeratorUserLogin string  `json:\"moderator_login\"`\n\tModeratorUserName  string  `json:\"moderator_name\"`\n}\n```\n\n```go\ntype BanEvent struct {\n\tID             string `db:\"id\" json:\"id\"`\n\tEventType      string `db:\"event_type\" json:\"event_type\"`\n\tEventTimestamp string `db:\"event_timestamp\" json:\"event_timestamp\"`\n\tEventVersion   string `db:\"event_version\" json:\"version\"`\n\tBanActionEvent `json:\"event_data\"`\n}\n```\n\n```go\ntype Block struct {\n\tUserID    string `db:\"user_id\" json:\"user_id\"`\n\tUserLogin string `db:\"user_login\" json:\"user_login\"`\n\tUserName  string `db:\"user_name\" json:\"display_name\"`\n}\n```\n\n```go\ntype CLIDatabase struct {\n\tDB *sqlx.DB\n}\n```\n\n```go\nfunc NewConnection(extendedBusyTimeout bool) (CLIDatabase, error)\n```\n\n```go\nfunc (c CLIDatabase) IsFirstRun() bool\n```\n\n```go\nfunc (c CLIDatabase) NewQuery(r *http.Request, max_limit int) *Query\n```\nNewQuery handles the logic for generating the pagination token to pass alongside the DB queries for easier access\n\n```go\nfunc (c CLIDatabase) NewQueryWithDefaultLimit(r *http.Request, max_limit int, default_limit int) *Query\n```\n\n```go\ntype Category struct {\n\tID          string `db:\"id\" json:\"id\"`\n\tName        string `db:\"category_name\" json:\"name\"`\n\tBoxartURL   string `json:\"box_art_url\"`\n\tViewerCount int    `db:\"vc\" json:\"-\"`\n\tIGDB        string `db:\"igdb_id\" json:\"igdb_id\"`\n}\n```\n\n```go\ntype ChannelPointsRedemption struct {\n\tID                                string         `db:\"id\" json:\"id\" dbs:\"cpr.id\"`\n\tBroadcasterID                     string         `db:\"broadcaster_id\" json:\"broadcaster_id\" dbs:\"cpr.broadcaster_id\"`\n\tBroadcasterLogin                  string         `db:\"broadcaster_login\" dbi:\"false\" json:\"broadcaster_login\"`\n\tBroadcasterName                   string         `db:\"broadcaster_name\" dbi:\"false\" json:\"broadcaster_name\"`\n\tUserID                            string         `db:\"user_id\" json:\"user_id\"`\n\tUserLogin                         string         `db:\"user_login\" dbi:\"false\" json:\"user_login\"`\n\tUserName                          string         `db:\"user_name\" dbi:\"false\" json:\"user_name\"`\n\tUserInput                         sql.NullString `db:\"user_input\" json:\"-\"`\n\tRealUserInput                     string         `json:\"user_input\"`\n\tRedemptionStatus                  string         `db:\"redemption_status\" json:\"status\"`\n\tRedeemedAt                        string         `db:\"redeemed_at\" json:\"redeemed_at\"`\n\tRewardID                          string         `db:\"reward_id\" json:\"-\"`\n\tChannelPointsRedemptionRewardInfo `json:\"reward\"`\n}\n```\n\n```go\ntype ChannelPointsRedemptionRewardInfo struct {\n\tID           string `dbi:\"false\" db:\"red_id\" json:\"id\" dbs:\"red.id\"`\n\tTitle        string `dbi:\"false\" db:\"title\" json:\"title\"`\n\tRewardPrompt string `dbi:\"false\" db:\"reward_prompt\" json:\"prompt\"`\n\tCost         int    `dbi:\"false\" db:\"cost\" json:\"cost\"`\n}\n```\n\n```go\ntype ChannelPointsReward struct {\n\tID                               string         `db:\"id\" json:\"id\" dbs:\"cpr.id\"`\n\tBroadcasterID                    string         `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tBroadcasterLogin                 string         `db:\"broadcaster_login\" dbi:\"false\" json:\"broadcaster_login\"`\n\tBroadcasterName                  string         `db:\"broadcaster_name\" dbi:\"false\" json:\"broadcaster_name\"`\n\tRewardImage                      sql.NullString `db:\"reward_image\" json:\"-\"`\n\tRealRewardImage                  *string        `json:\"image\"`\n\tBackgroundColor                  string         `db:\"background_color\" json:\"background_color\"`\n\tIsEnabled                        *bool          `db:\"is_enabled\" json:\"is_enabled\"`\n\tCost                             *int           `db:\"cost\" json:\"cost\"`\n\tTitle                            string         `db:\"title\" dbs:\"cpr.title\" json:\"title\"`\n\tRewardPrompt                     string         `db:\"reward_prompt\" json:\"prompt\"`\n\tIsUserInputRequired              bool           `db:\"is_user_input_required\" json:\"is_user_input_required\"`\n\tMaxPerStream                     `json:\"max_per_stream_setting\"`\n\tMaxPerUserPerStream              `json:\"max_per_user_per_stream_setting\"`\n\tGlobalCooldown                   `json:\"global_cooldown_setting\"`\n\tIsPaused                         bool `db:\"is_paused\" json:\"is_paused\"`\n\tIsInStock                        bool `db:\"is_in_stock\" json:\"is_in_stock\"`\n\tDefaultImage                     `dbi:\"false\" json:\"default_image\"`\n\tShouldRedemptionsSkipQueue       bool           `db:\"should_redemptions_skip_queue\" json:\"should_redemptions_skip_request_queue\"`\n\tRedemptionsRedeemedCurrentStream *int           `db:\"redemptions_redeemed_current_stream\" json:\"redemptions_redeemed_current_stream\"`\n\tCooldownExpiresAt                sql.NullString `db:\"cooldown_expires_at\" json:\"-\"`\n\tRealCooldownExpiresAt            *string        `json:\"cooldown_expires_at\"`\n}\n```\n\n```go\ntype ChatSettings struct {\n\tBroadcasterID                 string `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tSlowMode                      *bool  `db:\"slow_mode\" json:\"slow_mode\"`\n\tSlowModeWaitTime              *int   `db:\"slow_mode_wait_time\" json:\"slow_mode_wait_time\"`\n\tFollowerMode                  *bool  `db:\"follower_mode\" json:\"follower_mode\"`\n\tFollowerModeDuration          *int   `db:\"follower_mode_duration\" json:\"follower_mode_duration\"`\n\tSubscriberMode                *bool  `db:\"subscriber_mode\" json:\"subscriber_mode\"`\n\tEmoteMode                     *bool  `db:\"emote_mode\" json:\"emote_mode\"`\n\tUniqueChatMode                *bool  `db:\"unique_chat_mode\" json:\"unique_chat_mode\"`\n\tNonModeratorChatDelay         *bool  `db:\"non_moderator_chat_delay\" json:\"non_moderator_chat_delay\"`\n\tNonModeratorChatDelayDuration *int   `db:\"non_moderator_chat_delay_duration\" json:\"non_moderator_chat_delay_duration\"`\n\n\t// Shield mode\n\tShieldModeIsActive       bool   `db:\"shieldmode_is_active\" json:\"-\"`\n\tShieldModeModeratorID    string `db:\"shieldmode_moderator_id\" json:\"-\"`\n\tShieldModeModeratorLogin string `db:\"shieldmode_moderator_login\" json:\"-\"`\n\tShieldModeModeratorName  string `db:\"shieldmode_moderator_name\" json:\"-\"`\n\tShieldModeLastActivated  string `db:\"shieldmode_last_activated\" json:\"-\"`\n}\n```\n\n```go\ntype Clip struct {\n\tID              string  `db:\"id\" json:\"id\" dbs:\"c.id\"`\n\tBroadcasterID   string  `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tBroadcasterName string  `db:\"broadcaster_name\" json:\"broadcaster_name\" dbi:\"false\"`\n\tCreatorID       string  `db:\"creator_id\" json:\"creator_id\"`\n\tCreatorName     string  `db:\"creator_name\" json:\"creator_name\" dbi:\"false\"`\n\tVideoID         string  `db:\"video_id\" json:\"video_id\"`\n\tGameID          string  `db:\"game_id\" json:\"game_id\"`\n\tLanguage        string  `db:\"language\" dbi:\"false\" json:\"language\"`\n\tTitle           string  `db:\"title\" json:\"title\"`\n\tViewCount       int     `db:\"view_count\" json:\"view_count\"`\n\tCreatedAt       string  `db:\"created_at\" json:\"created_at\"`\n\tDuration        float64 `db:\"duration\" json:\"duration\"`\n\tVodOffset       int     `db:\"vod_offset\" json:\"vod_offset\"`\n\tIsFeatured      bool    `json:\"is_featured\"`\n\t// calculated fields\n\tURL          string `json:\"url\"`\n\tThumbnailURL string `json:\"thumbnail_url\"`\n\tEmbedURL     string `json:\"embed_url\"`\n\tStartedAt    string `db:\"started_at\" dbi:\"false\" json:\"-\"`\n\tEndedAt      string `db:\"ended_at\" dbi:\"false\" json:\"-\"`\n}\n```\n\n```go\ntype DBResponse struct {\n\tCursor string      `json:\"cursor\"`\n\tTotal  int         `json:\"total\"`\n\tLimit  int         `json:\"-\"`\n\tData   interface{} `json:\"data\"`\n}\n```\n\n```go\ntype DefaultImage struct {\n\tURL1x string `json:\"url_1x\"`\n\tURL2x string `json:\"url_2x\"`\n\tURL4x string `json:\"url_4x\"`\n}\n```\n\n```go\ntype DropsEntitlement struct {\n\tID          string `db:\"id\" json:\"id\" dbs:\"de.id\"`\n\tUserID      string `db:\"user_id\" json:\"user_id\"`\n\tBenefitID   string `db:\"benefit_id\" json:\"benefit_id\"`\n\tGameID      string `db:\"game_id\" json:\"game_id\"`\n\tTimestamp   string `db:\"timestamp\" json:\"timestamp\"`\n\tStatus      string `db:\"status\" json:\"fulfillment_status\"`\n\tLastUpdated string `db:\"last_updated\" json:\"last_updated\"`\n}\n```\n\n```go\ntype Editor struct {\n\tUserID    string `db:\"user_id\" json:\"user_id\"`\n\tUserLogin string `db:\"user_login\" json:\"-\"`\n\tUserName  string `db:\"user_name\" json:\"user_name\"`\n\tCreatedAt string `db:\"created_at\" json:\"created_at\"`\n}\n```\n\n```go\ntype EventCacheParameters struct {\n\tID        string `db:\"id\"`\n\tEvent     string `db:\"event\"`\n\tJSON      string `db:\"json\"`\n\tFromUser  string `db:\"from_user\"`\n\tToUser    string `db:\"to_user\"`\n\tTransport string `db:\"transport\"`\n\tTimestamp string `db:\"timestamp\"`\n}\n```\nEventCacheParameters is used to define required parameters when writing into the database\n\n```go\ntype EventCacheResponse struct {\n\tID        string\n\tEvent     string\n\tJSON      string\n\tTransport string\n\tTimestamp string\n}\n```\nEventCacheResponse is used to define the response coming from a SELECT-based function\n\n```go\ntype Follow struct {\n\tBroadcasterID    string `db:\"to_id\"`\n\tBroadcasterLogin string `db:\"to_login\"`\n\tBroadcasterName  string `db:\"to_name\"`\n\tViewerID         string `db:\"from_id\"`\n\tViewerLogin      string `db:\"from_login\"`\n\tViewerName       string `db:\"from_name\"`\n\tFollowedAt       string `db:\"created_at\"`\n}\n```\n\n```go\ntype GlobalCooldown struct {\n\tGlobalCooldownEnabled bool `db:\"global_cooldown_enabled\" json:\"is_enabled\" dbi:\"force\"`\n\tGlobalCooldownSeconds *int `db:\"global_cooldown_seconds\" json:\"global_cooldown_seconds\"`\n}\n```\n\n```go\ntype InternalCursor struct {\n\tOffset int `json:\"o\"`\n\tLimit  int `json:\"l\"`\n}\n```\n\n```go\ntype InternalPagination struct {\n\tSQL string\n\tInternalCursor\n\tPaginationCursor string\n}\n```\n\n```go\ntype MaxPerStream struct {\n\tStreamMaxEnabled bool `db:\"stream_max_enabled\" json:\"is_enabled\" dbi:\"force\"`\n\tStreamMaxCount   *int `db:\"stream_max_count\" json:\"max_per_stream\"`\n}\n```\n\n```go\ntype MaxPerUserPerStream struct {\n\tStreamUserMaxEnabled bool `db:\"stream_user_max_enabled\" json:\"is_enabled\" dbi:\"force\"`\n\tStreamMUserMaxCount  *int `db:\"stream_user_max_count\" json:\"max_per_user_per_stream\"`\n}\n```\n\n```go\ntype Moderator struct {\n\tUserID    string `db:\"user_id\" json:\"user_id\"`\n\tUserLogin string `db:\"user_login\" json:\"user_login\"`\n\tUserName  string `db:\"user_name\" json:\"user_name\"`\n}\n```\n\n```go\ntype ModeratorAction struct {\n\tID                   string `db:\"id\" json:\"id\"`\n\tEventType            string `db:\"event_type\" json:\"event_type\"`\n\tEventTimestamp       string `db:\"event_timestamp\" json:\"event_timestamp\"`\n\tEventVersion         string `db:\"event_version\" json:\"version\"`\n\tModeratorActionEvent `json:\"event_data\"`\n}\n```\n\n```go\ntype ModeratorActionEvent struct {\n\tBroadcasterID    string `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tBroadcasterLogin string `db:\"broadcaster_login\" json:\"broadcaster_login\"`\n\tBroadcasterName  string `db:\"broadcaster_name\" json:\"broadcaster_name\"`\n\tUserID           string `db:\"user_id\" json:\"user_id\"`\n\tUserLogin        string `db:\"user_login\" json:\"user_login\"`\n\tUserName         string `db:\"user_name\" json:\"user_name\"`\n}\n```\n\n```go\ntype Poll struct {\n\tID                         string        `db:\"id\" dbs:\"p.id\" json:\"id\"`\n\tBroadcasterID              string        `db:\"broadcaster_id\" dbs:\"u1.id\" json:\"broadcaster_id\"`\n\tBroadcasterLogin           string        `db:\"broadcaster_login\" dbi:\"false\" json:\"broadcaster_login\"`\n\tBroadcasterName            string        `db:\"broadcaster_name\" dbi:\"false\" json:\"broadcaster_name\"`\n\tTitle                      string        `db:\"title\" dbs:\"p.title\" json:\"title\"`\n\tBitsVotingEnabled          bool          `db:\"bits_voting_enabled\" json:\"bits_voting_enabled\"`\n\tBitsPerVote                int           `db:\"bits_per_vote\" json:\"bits_per_vote\"`\n\tChannelPointsVotingEnabled bool          `db:\"channel_points_voting_enabled\" json:\"channel_points_voting_enabled\"`\n\tChannelPointsPerVote       int           `db:\"channel_points_per_vote\" json:\"channel_points_per_vote\"`\n\tStatus                     string        `db:\"status\" json:\"status\"`\n\tDuration                   int           `db:\"duration\" json:\"duration\"`\n\tStartedAt                  string        `db:\"started_at\" json:\"started_at\"`\n\tEndedAt                    string        `db:\"ended_at\" json:\"ended_at,omitempty\"`\n\tChoices                    []PollsChoice `json:\"choices\"`\n}\n```\n\n```go\ntype PollsChoice struct {\n\tID                 string `db:\"id\" json:\"id\"`\n\tTitle              string `db:\"title\" json:\"title\"`\n\tVotes              int    `db:\"votes\" json:\"votes\"`\n\tChannelPointsVotes int    `db:\"channel_points_votes\" json:\"channel_points_votes\"`\n\tBitsVotes          int    `db:\"bits_votes\" json:\"bits_votes\"`\n\tPollID             string `db:\"poll_id\" json:\"-\"`\n}\n```\n\n```go\ntype Prediction struct {\n\tID               string              `db:\"id\" dbs:\"p.id\" json:\"id\"`\n\tBroadcasterID    string              `db:\"broadcaster_id\" dbs:\"u1.id\" json:\"broadcaster_id\"`\n\tBroadcasterLogin string              `db:\"broadcaster_login\" dbi:\"false\" json:\"broadcaster_login\"`\n\tBroadcasterName  string              `db:\"broadcaster_name\" dbi:\"false\" json:\"broadcaster_name\"`\n\tTitle            string              `db:\"title\" json:\"title\"`\n\tWinningOutcomeID *string             `db:\"winning_outcome_id\" json:\"winning_outcome_id\"`\n\tPredictionWindow int                 `db:\"prediction_window\" json:\"prediction_window\"`\n\tStatus           string              `db:\"status\" json:\"status\"`\n\tStartedAt        string              `db:\"created_at\" json:\"created_at\"`\n\tEndedAt          *string             `db:\"ended_at\" json:\"ended_at\"`\n\tLockedAt         *string             `db:\"locked_at\" json:\"locked_at\"`\n\tOutcomes         []PredictionOutcome `json:\"outcomes\"`\n}\n```\n\n```go\ntype PredictionOutcome struct {\n\tID            string                  `db:\"id\" dbs:\"po.id\" json:\"id\"`\n\tTitle         string                  `db:\"title\" json:\"title\"`\n\tUsers         int                     `db:\"users\" json:\"users\"`\n\tChannelPoints int                     `db:\"channel_points\" json:\"channel_points\"`\n\tTopPredictors []*PredictionPrediction `json:\"top_predictors\"`\n\tColor         string                  `db:\"color\" json:\"color\"`\n\tPredictionID  string                  `db:\"prediction_id\" json:\"-\"`\n}\n```\n\n```go\ntype PredictionPrediction struct {\n\tPredictionID string `db:\"prediction_id\" json:\"-\"`\n\tUserID       string `db:\"user_id\" json:\"user_id\"`\n\tUserLogin    string `db:\"user_login\" dbi:\"false\" json:\"user_login\"`\n\tUserName     string `db:\"user_name\" dbi:\"false\" json:\"user_name\"`\n\tAmount       int    `db:\"amount\" json:\"channel_points_used\"`\n\tOutcomeID    string `db:\"outcome_id\" json:\"-\"`\n\t// calculated fields\n\tAmountWon int `json:\"channel_points_won\"`\n}\n```\n\n```go\ntype Query struct {\n\tLimit  int\n\tCursor string\n\tInternalPagination\n\tDB *sqlx.DB\n}\n```\n\n```go\nfunc (q *Query) AddBlock(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) AddEditor(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) AddFollow(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) AddModerator(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) AddVIP(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) CreateAuthorization(a Authorization) (Authorization, error)\n```\n\n```go\nfunc (q *Query) DeleteBan(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) DeleteBlock(from_user string, to_user string) error\n```\n\n```go\nfunc (q *Query) DeleteChannelPointsReward(id string) error\n```\n\n```go\nfunc (q *Query) DeleteFollow(from_user string, to_user string) error\n```\n\n```go\nfunc (q *Query) DeleteSegment(id string, broadcasterID string) error\n```\n\n```go\nfunc (q *Query) DeleteVIP(broadcaster string, user string) error\n```\n\n```go\nfunc (q *Query) DeleteVideo(id string) error\n```\n\n```go\nfunc (q *Query) GetAuthenticationClient(ac AuthenticationClient) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetAuthorizationByToken(token string) (Authorization, error)\n```\n\n```go\nfunc (q *Query) GetBanEvents(p UserRequestParams) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetBans(p UserRequestParams) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetBlocks(p UserRequestParams) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetCategories(cat Category) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetChannelPointsRedemption(cpr ChannelPointsRedemption, sort string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetChannelPointsReward(cpr ChannelPointsReward) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetChannels(u User) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetChatSettingsByBroadcaster(broadcaster string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetClips(c Clip, startDate string, endDate string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetDropsEntitlements(de DropsEntitlement) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetEditors(u User) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetEventByID(id string) (EventCacheResponse, error)\n```\nGetEventByID returns an event based on an ID provided for replay.\n\n```go\nfunc (q *Query) GetFollowedStreams(userID string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetFollows(p UserRequestParams, totalsFromUser bool) (*DBResponse, error)\n```\n\"Total\" returned depends on totalsFromUser bool. \"true\" will return the number of people the user from p.UserID currently follows. \"false\" will return the number of people the user from p.BroadcasterID currently follows.\n\n```go\nfunc (q *Query) GetModerationActionsByBroadcaster(broadcaster string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetModeratorEvents(p UserRequestParams) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetModerators(p UserRequestParams) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetModeratorsForBroadcaster(broadcasterID string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetPolls(p Poll) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetPredictions(p Prediction) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetSchedule(p ScheduleSegment, startTime time.Time) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetStream(s Stream) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetStreamMarkers(sm StreamMarker) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetSubscriptions(s Subscription) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetTags(t Tag) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetTeam(t Team) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetTeamByBroadcaster(broadcasterID string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetTopGames() (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetUser(u User) (User, error)\n```\n\n```go\nfunc (q *Query) GetUsers(u User) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetVIPsByBroadcaster(broadcaster string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) GetVacations(p ScheduleSegment) (ScheduleVacation, error)\n```\n\n```go\nfunc (q *Query) GetVideos(v Video, period string, sort string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) InsertBan(p UserRequestParams) error\n```\n\n```go\nfunc (q *Query) InsertCategory(category Category, upsert bool) error\n```\n\n```go\nfunc (q *Query) InsertChannelPointsRedemption(r ChannelPointsRedemption) error\n```\n\n```go\nfunc (q *Query) InsertChannelPointsReward(r ChannelPointsReward) error\n```\n\n```go\nfunc (q *Query) InsertChatSettings(s ChatSettings) error\n```\n\n```go\nfunc (q *Query) InsertClip(c Clip) error\n```\n\n```go\nfunc (q *Query) InsertDropsEntitlement(d DropsEntitlement) error\n```\n\n```go\nfunc (q *Query) InsertIntoDB(p EventCacheParameters) error\n```\nInsertIntoDB inserts an event into the database for replay functions later.\n\n```go\nfunc (q *Query) InsertMutedSegmentsForVideo(vms VideoMutedSegment) error\n```\n\n```go\nfunc (q *Query) InsertOrUpdateAuthenticationClient(client AuthenticationClient, upsert bool) (AuthenticationClient, error)\n```\n\n```go\nfunc (q *Query) InsertPoll(p Poll) error\n```\n\n```go\nfunc (q *Query) InsertPrediction(p Prediction) error\n```\n\n```go\nfunc (q *Query) InsertPredictionPrediction(p PredictionPrediction) error\n```\n\n```go\nfunc (q *Query) InsertSchedule(p ScheduleSegment) error\n```\n\n```go\nfunc (q *Query) InsertStream(p Stream, upsert bool) error\n```\n\n```go\nfunc (q *Query) InsertStreamMarker(sm StreamMarker) error\n```\n\n```go\nfunc (q *Query) InsertSubscription(s SubscriptionInsert) error\n```\n\n```go\nfunc (q *Query) InsertTag(t Tag) error\n```\n\n```go\nfunc (q *Query) InsertTeam(t Team) error\n```\n\n```go\nfunc (q *Query) InsertTeamMember(tm TeamMember) error\n```\n\n```go\nfunc (q *Query) InsertUser(u User, upsert bool) error\n```\n\n```go\nfunc (q *Query) InsertVideo(v Video) error\n```\n\n```go\nfunc (q *Query) RemoveModerator(broadcaster string, user string) error\n```\n\n```go\nfunc (q *Query) SearchCategories(query string) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) SearchChannels(query string, live_only bool) (*DBResponse, error)\n```\n\n```go\nfunc (q *Query) UpdateChannel(id string, u User) error\n```\n\n```go\nfunc (q *Query) UpdateChannelPointsRedemption(r ChannelPointsRedemption) error\n```\n\n```go\nfunc (q *Query) UpdateChannelPointsReward(r ChannelPointsReward) error\n```\n\n```go\nfunc (q *Query) UpdateChatSettings(s ChatSettings) error\n```\n\n```go\nfunc (q *Query) UpdateDropsEntitlement(d DropsEntitlement) error\n```\n\n```go\nfunc (q *Query) UpdatePoll(p Poll) error\n```\n\n```go\nfunc (q *Query) UpdatePollChoice(p PollsChoice) error\n```\n\n```go\nfunc (q *Query) UpdatePrediction(p Prediction) error\n```\n\n```go\nfunc (q *Query) UpdateSegment(p ScheduleSegment) error\n```\n\n```go\ntype Schedule struct {\n\tSegments  []ScheduleSegment `json:\"segments\"`\n\tUserID    string            `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tUserLogin string            `db:\"broadcaster_login\" json:\"broadcaster_login\" dbi:\"false\"`\n\tUserName  string            `db:\"broadcaster_name\" json:\"broadcaster_name\" dbi:\"false\"`\n\tVacation  *ScheduleVacation `json:\"vacation\"`\n}\n```\n\n```go\ntype ScheduleSegment struct {\n\tID            string           `db:\"id\" json:\"id\" dbs:\"s.id\"`\n\tTitle         string           `db:\"title\" json:\"title\"`\n\tStartTime     string           `db:\"starttime\" json:\"start_time\"`\n\tEndTime       string           `db:\"endtime\" json:\"end_time\"`\n\tIsRecurring   bool             `db:\"is_recurring\" json:\"is_recurring\"`\n\tIsVacation    bool             `db:\"is_vacation\" json:\"-\"`\n\tCategory      *SegmentCategory `json:\"category\"`\n\tUserID        string           `db:\"broadcaster_id\" json:\"-\"`\n\tCategoryID    *string          `db:\"category_id\" json:\"-\"`\n\tCategoryName  *string          `db:\"category_name\" dbi:\"false\" json:\"-\"`\n\tIsCanceled    *bool            `db:\"is_canceled\" json:\"-\"`\n\tCanceledUntil *string          `json:\"canceled_until\"`\n}\n```\n\n```go\ntype ScheduleVacation struct {\n\tID        string `db:\"id\" json:\"-\"`\n\tStartTime string `db:\"starttime\" json:\"start_time\"`\n\tEndTime   string `db:\"endtime\" json:\"end_time\"`\n}\n```\n\n```go\ntype SearchChannel struct {\n\tID           string   `db:\"id\" json:\"id\" dbs:\"u1.id\"`\n\tUserLogin    string   `db:\"user_login\" json:\"broadcaster_login\"`\n\tDisplayName  string   `db:\"display_name\" json:\"display_name\"`\n\tCategoryID   *string  `db:\"category_id\" json:\"game_id\" dbi:\"false\"`\n\tCategoryName *string  `db:\"category_name\" json:\"game_name\" dbi:\"false\"`\n\tTitle        string   `db:\"title\" json:\"title\"`\n\tLanguage     string   `db:\"stream_language\" json:\"broadcaster_language\"`\n\tTagIDs       []string `json:\"tag_ids\" dbi:\"false\"`\n\tTags         []string `json:\"tags\" dbi:\"false\"`\n\tIsLive       bool     `json:\"is_live\" db:\"is_live\"`\n\tStartedAt    *string  `db:\"started_at\" json:\"started_at\"`\n\t// calculated fields\n\tThumbNailURL string `json:\"thumbnail_url\"`\n}\n```\n\n```go\ntype SegmentCategory struct {\n\tID           *string `db:\"category_id\" json:\"id\" dbs:\"category_id\"`\n\tCategoryName *string `db:\"category_name\" json:\"name\" dbi:\"false\"`\n}\n```\n\n```go\ntype Stream struct {\n\tID          string   `db:\"id\" json:\"id\" dbs:\"s.id\"`\n\tUserID      string   `db:\"broadcaster_id\" json:\"user_id\"`\n\tUserLogin   string   `db:\"broadcaster_login\" json:\"user_login\" dbi:\"false\"`\n\tUserName    string   `db:\"broadcaster_name\" json:\"user_name\" dbi:\"false\"`\n\tStreamType  string   `db:\"stream_type\" json:\"type\"`\n\tViewerCount int      `db:\"viewer_count\" json:\"viewer_count\"`\n\tStartedAt   string   `db:\"started_at\" json:\"started_at\"`\n\tIsMature    bool     `db:\"is_mature\" json:\"is_mature\"`\n\tTagIDs      []string `json:\"tag_ids\" dbi:\"false\"`\n\tTags        []string `json:\"tags\" dbi:\"false\"`\n\t// stored in users, but pulled here for json parsing\n\tCategoryID       sql.NullString `db:\"category_id\" json:\"-\" dbi:\"false\"`\n\tRealCategoryID   string         `json:\"game_id\"`\n\tCategoryName     sql.NullString `db:\"category_name\" json:\"-\" dbi:\"false\"`\n\tRealCategoryName string         `json:\"game_name\"`\n\tTitle            string         `db:\"title\" json:\"title\" dbi:\"false\"`\n\tLanguage         string         `db:\"stream_language\" json:\"language\" dbi:\"false\"`\n\t// calculated fields\n\tThumbnailURL string `json:\"thumbnail_url\"`\n}\n```\n\n```go\ntype StreamMarker struct {\n\tID              string `db:\"id\" dbs:\"sm.id\" json:\"id\"`\n\tCreatedAt       string `db:\"created_at\" json:\"created_at\"`\n\tPositionSeconds int    `db:\"position_seconds\" json:\"position_seconds\"`\n\tDescription     string `db:\"description\" json:\"description\"`\n\tBroadcasterID   string `db:\"broadcaster_id\" json:\"-\"`\n\tVideoID         string `db:\"video_id\" dbs:\"v.id\" json:\"-\"`\n\tURL             string `json:\"URL\"`\n}\n```\n\n```go\ntype StreamMarkerUser struct {\n\tBroadcasterID    string              `db:\"broadcaster_id\" json:\"user_id\"`\n\tBroadcasterLogin string              `db:\"broadcaster_login\" json:\"user_login\" dbi:\"false\"`\n\tBroadcasterName  string              `db:\"broadcaster_name\" json:\"user_name\" dbi:\"false\"`\n\tVideos           []StreamMarkerVideo `json:\"videos\"`\n}\n```\n\n```go\ntype StreamMarkerVideo struct {\n\tVideoID string         `db:\"video_id\" dbs:\"v.id\" json:\"video_id\"`\n\tMarkers []StreamMarker `json:\"markers\"`\n}\n```\n\n```go\ntype Subscription struct {\n\tBroadcasterID    string          `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tBroadcasterLogin string          `db:\"broadcaster_login\" json:\"broadcaster_login\"`\n\tBroadcasterName  string          `db:\"broadcaster_name\" json:\"broadcaster_name\"`\n\tUserID           string          `db:\"user_id\" json:\"user_id\"`\n\tUserLogin        string          `db:\"user_login\" json:\"user_login\"`\n\tUserName         string          `db:\"user_name\" json:\"user_name\"`\n\tIsGift           bool            `db:\"is_gift\" json:\"is_gift\"`\n\tGifterID         *sql.NullString `db:\"gifter_id\" json:\"gifter_id\"`\n\tGifterName       *sql.NullString `db:\"gifter_name\" json:\"gifter_name\"`\n\tGifterLogin      *sql.NullString `db:\"gifter_login\" json:\"gifter_login\"`\n\tTier             string          `db:\"tier\" json:\"tier\"`\n\tCreatedAt        string          `db:\"created_at\" json:\"-\"`\n\t// calculated fields\n\tPlanName string `json:\"plan_name\"`\n}\n```\n\n```go\ntype SubscriptionInsert struct {\n\tBroadcasterID string          `db:\"broadcaster_id\" json:\"broadcaster_id\"`\n\tUserID        string          `db:\"user_id\" json:\"user_id\"`\n\tIsGift        bool            `db:\"is_gift\" json:\"is_gift\"`\n\tGifterID      *sql.NullString `db:\"gifter_id\" json:\"gifter_id,omitempty\"`\n\tTier          string          `db:\"tier\" json:\"tier\"`\n\tCreatedAt     string          `db:\"created_at\" json:\"-\"`\n}\n```\n\n```go\ntype Tag struct {\n\tID     string `db:\"id\" json:\"id\"`\n\tIsAuto bool   `db:\"is_auto\" dbi:\"false\" json:\"is_auto\"`\n\tName   string `db:\"tag_name\" json:\"tag_name\"`\n}\n```\n\n```go\ntype Team struct {\n\tID                 string       `db:\"id\" json:\"id\"`\n\tBackgroundImageUrl *string      `db:\"background_image_url\" json:\"background_image_url\"`\n\tBanner             *string      `db:\"banner\" json:\"banner\"`\n\tCreatedAt          string       `db:\"created_at\" json:\"created_at\"`\n\tUpdatedAt          string       `db:\"updated_at\" json:\"updated_at\"`\n\tInfo               string       `db:\"info\" json:\"info\"`\n\tThumbnailURL       string       `db:\"thumbnail_url\" json:\"thumbnail_url\"`\n\tTeamName           string       `db:\"team_name\" json:\"team_name\"`\n\tTeamDisplayName    string       `db:\"team_display_name\" json:\"team_display_name\"`\n\tUsers              []TeamMember `json:\"users\"`\n}\n```\n\n```go\ntype TeamMember struct {\n\tTeamID    string `db:\"team_id\" json:\"-\"`\n\tUserID    string `db:\"user_id\" json:\"user_id\"`\n\tUserName  string `db:\"user_name\" json:\"user_name\" dbi:\"false\"`\n\tUserLogin string `db:\"user_login\" json:\"user_login\" dbi:\"false\"`\n}\n```\n\n```go\ntype User struct {\n\tID               string         `db:\"id\" json:\"id\" dbs:\"u1.id\"`\n\tUserLogin        string         `db:\"user_login\" json:\"login\"`\n\tDisplayName      string         `db:\"display_name\" json:\"display_name\"`\n\tEmail            string         `db:\"email\" json:\"email,omitempty\"`\n\tUserType         string         `db:\"user_type\" json:\"type\"`\n\tBroadcasterType  string         `db:\"broadcaster_type\" json:\"broadcaster_type\"`\n\tUserDescription  string         `db:\"user_description\" json:\"description\"`\n\tCreatedAt        string         `db:\"created_at\" json:\"created_at\"`\n\tModifiedAt       string         `db:\"modified_at\" json:\"-\"`\n\tProfileImageURL  string         `dbi:\"false\" json:\"profile_image_url\" `\n\tOfflineImageURL  string         `dbi:\"false\" json:\"offline_image_url\" `\n\tViewCount        int            `dbi:\"false\" json:\"view_count\"`\n\tCategoryID       sql.NullString `db:\"category_id\" json:\"game_id\" dbi:\"force\"`\n\tCategoryName     sql.NullString `db:\"category_name\" json:\"game_name\" dbi:\"false\"`\n\tTitle            string         `db:\"title\" json:\"title\"`\n\tLanguage         string         `db:\"stream_language\" json:\"stream_language\"`\n\tDelay            int            `db:\"delay\" json:\"delay\" dbi:\"force\"`\n\tChatColor        string         `db:\"chat_color\" json:\"-\"`\n\tIsBrandedContent bool           `db:\"branded_content\" json:\"is_branded_content\"`\n\n\t// UnparsedCCLs is a comma seperated array (e.g. \"Gambling,ViolentGraphic,ProfanityVulgarity\")\n\tUnparsedCCLs string `db:\"content_labels\" json:\"-\"`\n}\n```\n\n```go\ntype UserRequestParams struct {\n\tBroadcasterID string `db:\"broadcaster_id\"`\n\tUserID        string `db:\"user_id\"`\n\tCreatedAt     string `db:\"created_at\"`\n}\n```\n\n```go\ntype VIP struct {\n\tBroadcasterID string `db:\"broadcaster_id\"`\n\tUserID        string `db:\"user_id\"`\n\tCreatedAt     string `db:\"created_at\"`\n}\n```\n\n```go\ntype Video struct {\n\tID               string              `db:\"id\" json:\"id\" dbs:\"v.id\"`\n\tStreamID         *string             `db:\"stream_id\" json:\"stream_id\"`\n\tBroadcasterID    string              `db:\"broadcaster_id\" json:\"user_id\"`\n\tBroadcasterLogin string              `db:\"broadcaster_login\" json:\"user_login\" dbi:\"false\"`\n\tBroadcasterName  string              `db:\"broadcaster_name\" json:\"user_name\" dbi:\"false\"`\n\tTitle            string              `db:\"title\" json:\"title\"`\n\tVideoDescription string              `db:\"video_description\" json:\"description\"`\n\tCreatedAt        string              `db:\"created_at\" json:\"created_at\"`\n\tPublishedAt      string              `db:\"published_at\" json:\"published_at\"`\n\tViewable         string              `db:\"viewable\" json:\"viewable\"`\n\tViewCount        int                 `db:\"view_count\" json:\"view_count\"`\n\tDuration         string              `db:\"duration\" json:\"duration\"`\n\tVideoLanguage    string              `db:\"video_language\" json:\"language\"`\n\tMutedSegments    []VideoMutedSegment `json:\"muted_segments\"`\n\tCategoryID       *string             `db:\"category_id\" dbs:\"v.category_id\" json:\"-\"`\n\tType             string              `db:\"type\" json:\"type\"`\n\t// calculated fields\n\tURL          string `json:\"url\"`\n\tThumbnailURL string `json:\"thumbnail_url\"`\n\tPeriodDate   string `db:\"period_date\" dbi:\"false\" json:\"-\"`\n}\n```\n\n```go\ntype VideoMutedSegment struct {\n\tVideoID     string `db:\"video_id\" json:\"-\"`\n\tVideoOffset int    `db:\"video_offset\" json:\"offset\"`\n\tDuration    int    `db:\"duration\" json:\"duration\"`\n}\n```\n\n","path":"github.com/twitchdev/twitch-cli/internal/database","name":"database","synopsis":"","isRedistributable":true}
