// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.30.0

package sqlc

import (
	"context"

	"github.com/google/uuid"
)

type Querier interface {
	BulkInitializeSourceSyncs(ctx context.Context, arg BulkInitializeSourceSyncsParams) error
	// Bulk insert or update CONFIG sources (only updates existing CONFIG sources)
	BulkUpsertConfigSources(ctx context.Context, arg BulkUpsertConfigSourcesParams) ([]BulkUpsertConfigSourcesRow, error)
	CountEntryVersions(ctx context.Context, entryID uuid.UUID) (int64, error)
	// Count how many registries reference a given source (via registry_source junction).
	CountRegistriesBySourceID(ctx context.Context, sourceID uuid.UUID) (int64, error)
	// Temp Entry Version Table Operations
	CreateTempEntryVersionTable(ctx context.Context) error
	// Temp Icon Table Operations
	CreateTempIconTable(ctx context.Context) error
	// Temp Package Table Operations
	CreateTempPackageTable(ctx context.Context) error
	// Temporary table operations for bulk sync
	// Note: These queries reference temp tables that don't exist in the schema.
	// sqlc cannot validate these, but we organize them here for maintainability.
	// Temp Server Table Operations
	CreateTempRegistryEntryTable(ctx context.Context) error
	// Temp Remote Table Operations
	CreateTempRemoteTable(ctx context.Context) error
	// Temp Server Table Operations
	CreateTempServerTable(ctx context.Context) error
	// Delete CONFIG registry rows whose names are not in the provided list.
	// Used during config sync to clean up registry/junction rows before deleting orphaned sources.
	DeleteConfigRegistriesNotInList(ctx context.Context, keepNames []string) error
	// Delete CONFIG sources not in the provided list (for config file sync)
	DeleteConfigSourcesNotInList(ctx context.Context, ids []uuid.UUID) error
	DeleteEntryVersion(ctx context.Context, arg DeleteEntryVersionParams) (int64, error)
	DeleteOrphanedEntryVersions(ctx context.Context, arg DeleteOrphanedEntryVersionsParams) error
	DeleteOrphanedIcons(ctx context.Context, serverIds []uuid.UUID) error
	DeleteOrphanedPackages(ctx context.Context, serverIds []uuid.UUID) error
	DeleteOrphanedRemotes(ctx context.Context, serverIds []uuid.UUID) error
	// Delete a registry by name. Go callers guard against deleting wrong creation_type.
	DeleteRegistry(ctx context.Context, name string) (int64, error)
	DeleteRegistryEntry(ctx context.Context, arg DeleteRegistryEntryParams) (int64, error)
	DeleteRegistryEntryByID(ctx context.Context, id uuid.UUID) (int64, error)
	DeleteServerIconsByServerId(ctx context.Context, serverID uuid.UUID) error
	DeleteServerPackagesByServerId(ctx context.Context, serverID uuid.UUID) error
	DeleteServerRemotesByServerId(ctx context.Context, serverID uuid.UUID) error
	DeleteServersByRegistry(ctx context.Context, sourceID uuid.UUID) error
	DeleteSkillGitPackagesBySkillId(ctx context.Context, skillID uuid.UUID) error
	DeleteSkillOciPackagesBySkillId(ctx context.Context, skillID uuid.UUID) error
	DeleteSkillsByRegistry(ctx context.Context, sourceID uuid.UUID) error
	// Delete a source by name. Go callers guard against deleting wrong creation_type.
	DeleteSource(ctx context.Context, name string) (int64, error)
	DropTempEntryVersionTable(ctx context.Context) error
	DropTempRegistryEntryTable(ctx context.Context) error
	GetAPISourcesByNames(ctx context.Context, names []string) ([]GetAPISourcesByNamesRow, error)
	GetLatestEntryVersion(ctx context.Context, arg GetLatestEntryVersionParams) (string, error)
	GetManagedSources(ctx context.Context) ([]GetManagedSourcesRow, error)
	GetRegistryByName(ctx context.Context, name string) (Registry, error)
	GetRegistryEntryByName(ctx context.Context, arg GetRegistryEntryByNameParams) (GetRegistryEntryByNameRow, error)
	GetServerIDsByRegistryNameVersion(ctx context.Context, sourceID uuid.UUID) ([]GetServerIDsByRegistryNameVersionRow, error)
	// Despite the name, this query returns multiple rows. The actual number of
	// records is bounded by the number of sources that provide the same name and
	// version, which we currently don't expect to be more than a few.
	// Cursor-based pagination using (position, source_id) compound cursor.
	// position is the sort key but may not be unique; source_id is the tiebreaker.
	GetServerVersion(ctx context.Context, arg GetServerVersionParams) ([]GetServerVersionRow, error)
	// Source-scoped variant of GetServerVersion used by the publish fetch-back path.
	// source_name and version are required; registry filtering is not applied.
	GetServerVersionBySourceName(ctx context.Context, arg GetServerVersionBySourceNameParams) (GetServerVersionBySourceNameRow, error)
	// Despite the name, this query returns multiple rows. The actual number of
	// records is bounded by the number of sources that provide the same name and
	// version, which we currently don't expect to be more than a few.
	// Cursor-based pagination using (position, source_id) compound cursor.
	// position is the sort key but may not be unique; source_id is the tiebreaker.
	GetSkillVersion(ctx context.Context, arg GetSkillVersionParams) ([]GetSkillVersionRow, error)
	// Source-scoped variant of GetSkillVersion used by the publish fetch-back path.
	// source_name and version are required; registry filtering is not applied.
	GetSkillVersionBySourceName(ctx context.Context, arg GetSkillVersionBySourceNameParams) (GetSkillVersionBySourceNameRow, error)
	GetSource(ctx context.Context, id uuid.UUID) (GetSourceRow, error)
	GetSourceByName(ctx context.Context, name string) (GetSourceByNameRow, error)
	GetSourceSync(ctx context.Context, id uuid.UUID) (RegistrySync, error)
	GetSourceSyncByName(ctx context.Context, name string) (RegistrySync, error)
	InitializeSourceSync(ctx context.Context, arg InitializeSourceSyncParams) error
	InsertEntryVersion(ctx context.Context, arg InsertEntryVersionParams) (uuid.UUID, error)
	InsertRegistryEntry(ctx context.Context, arg InsertRegistryEntryParams) (uuid.UUID, error)
	InsertServerIcon(ctx context.Context, arg InsertServerIconParams) error
	// TODO: this seems unused
	InsertServerPackage(ctx context.Context, arg InsertServerPackageParams) error
	InsertServerRemote(ctx context.Context, arg InsertServerRemoteParams) error
	InsertServerVersion(ctx context.Context, arg InsertServerVersionParams) (uuid.UUID, error)
	InsertServerVersionForSync(ctx context.Context, arg InsertServerVersionForSyncParams) (uuid.UUID, error)
	InsertSkillGitPackage(ctx context.Context, arg InsertSkillGitPackageParams) error
	InsertSkillOciPackage(ctx context.Context, arg InsertSkillOciPackageParams) error
	InsertSkillVersion(ctx context.Context, arg InsertSkillVersionParams) (uuid.UUID, error)
	InsertSkillVersionForSync(ctx context.Context, arg InsertSkillVersionForSyncParams) (uuid.UUID, error)
	// ============================================================================
	// Source Queries (unified, creation_type guards are in Go)
	// ============================================================================
	// Insert a new source with full configuration. creation_type is passed as a parameter.
	InsertSource(ctx context.Context, arg InsertSourceParams) (Source, error)
	InsertSourceSync(ctx context.Context, arg InsertSourceSyncParams) (uuid.UUID, error)
	LinkRegistrySource(ctx context.Context, arg LinkRegistrySourceParams) error
	ListAllSourceNames(ctx context.Context) ([]string, error)
	ListEntriesByRegistry(ctx context.Context, registryID uuid.UUID) ([]ListEntriesByRegistryRow, error)
	ListEntriesBySource(ctx context.Context, sourceID uuid.UUID) ([]ListEntriesBySourceRow, error)
	ListEntryVersions(ctx context.Context, entryID uuid.UUID) ([]ListEntryVersionsRow, error)
	// Queries for the new lightweight registry table and registry_source junction.
	ListRegistries(ctx context.Context, arg ListRegistriesParams) ([]Registry, error)
	ListRegistrySources(ctx context.Context, registryID uuid.UUID) ([]ListRegistrySourcesRow, error)
	ListServerPackages(ctx context.Context, versionIds []uuid.UUID) ([]ListServerPackagesRow, error)
	ListServerRemotes(ctx context.Context, versionIds []uuid.UUID) ([]McpServerRemote, error)
	// Cursor-based pagination using (name, version) compound cursor.
	// The cursor_name and cursor_version parameters define the starting point.
	// When cursor is provided, results start AFTER the specified (name, version) tuple.
	// Returns position from registry_source for source priority ordering.
	// When name is provided, results are filtered to versions of that specific server.
	ListServers(ctx context.Context, arg ListServersParams) ([]ListServersRow, error)
	ListSkillGitPackages(ctx context.Context, versionIds []uuid.UUID) ([]SkillGitPackage, error)
	ListSkillOciPackages(ctx context.Context, versionIds []uuid.UUID) ([]SkillOciPackage, error)
	// Cursor-based pagination using (name, version) compound cursor.
	// The cursor_name and cursor_version parameters define the starting point.
	// When cursor is provided, results start AFTER the specified (name, version) tuple.
	// Returns position from registry_source for source priority ordering.
	ListSkills(ctx context.Context, arg ListSkillsParams) ([]ListSkillsRow, error)
	ListSourceSyncs(ctx context.Context) ([]ListSourceSyncsRow, error)
	ListSourceSyncsByLastUpdate(ctx context.Context) ([]ListSourceSyncsByLastUpdateRow, error)
	ListSources(ctx context.Context, arg ListSourcesParams) ([]ListSourcesRow, error)
	// Update all registry entries for a source to match the source's current claims.
	// Used during initialization to fix drift when source claims change without data change.
	PropagateSourceClaimsToEntries(ctx context.Context, arg PropagateSourceClaimsToEntriesParams) error
	UnlinkAllRegistrySources(ctx context.Context, registryID uuid.UUID) error
	UnlinkRegistrySource(ctx context.Context, arg UnlinkRegistrySourceParams) error
	UpdateRegistryEntryClaims(ctx context.Context, arg UpdateRegistryEntryClaimsParams) (int64, error)
	// Update an existing source. Go callers guard against modifying wrong creation_type.
	UpdateSource(ctx context.Context, arg UpdateSourceParams) (Source, error)
	UpdateSourceSync(ctx context.Context, arg UpdateSourceSyncParams) error
	UpdateSourceSyncStatusByName(ctx context.Context, arg UpdateSourceSyncStatusByNameParams) error
	UpsertEntryVersionsFromTemp(ctx context.Context) ([]UpsertEntryVersionsFromTempRow, error)
	UpsertIconsFromTemp(ctx context.Context) error
	UpsertLatestServerVersion(ctx context.Context, arg UpsertLatestServerVersionParams) (uuid.UUID, error)
	UpsertLatestSkillVersion(ctx context.Context, arg UpsertLatestSkillVersionParams) (uuid.UUID, error)
	UpsertPackagesFromTemp(ctx context.Context) error
	// Insert or update a registry. The creation_type is passed as a parameter.
	// Business logic in Go guards against cross-type overwrites.
	UpsertRegistry(ctx context.Context, arg UpsertRegistryParams) (Registry, error)
	UpsertRegistryEntriesFromTemp(ctx context.Context) ([]UpsertRegistryEntriesFromTempRow, error)
	UpsertRemotesFromTemp(ctx context.Context) error
	UpsertServerVersionForSync(ctx context.Context, arg UpsertServerVersionForSyncParams) (uuid.UUID, error)
	UpsertServersFromTemp(ctx context.Context) error
	UpsertSkillVersionForSync(ctx context.Context, arg UpsertSkillVersionForSyncParams) (uuid.UUID, error)
	// ============================================================================
	// CONFIG Source Queries (only operate on creation_type='CONFIG')
	// ============================================================================
	// Insert or update a source. The creation_type is passed as a parameter.
	// Business logic in Go guards against cross-type overwrites.
	UpsertSource(ctx context.Context, arg UpsertSourceParams) (uuid.UUID, error)
	UpsertSourceSyncByName(ctx context.Context, arg UpsertSourceSyncByNameParams) error
}

var _ Querier = (*Queries)(nil)
