sqlc

package
v0.70.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearStagedVersionParams

type ClearStagedVersionParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
}

type CreateNamespaceParams

type CreateNamespaceParams struct {
	ID       string `json:"id"`
	Metadata []byte `json:"metadata"`
}

type CreateSchemaParams

type CreateSchemaParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Metadata    []byte `json:"metadata"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetBlobParams

type GetBlobParams struct {
	NamespaceID string `json:"namespace_id"`
	Sha256      string `json:"sha256"`
}

type GetBlobsByHashesParams

type GetBlobsByHashesParams struct {
	NamespaceID string   `json:"namespace_id"`
	Column2     []string `json:"column_2"`
}

type GetDependentsParams

type GetDependentsParams struct {
	NamespaceID string `json:"namespace_id"`
	DepSchemaID string `json:"dep_schema_id"`
}

type GetDependentsRow

type GetDependentsRow struct {
	SchemaID string `json:"schema_id"`
	Version  int64  `json:"version"`
}

type GetSchemaForUpdateParams

type GetSchemaForUpdateParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
}

type GetSchemaParams

type GetSchemaParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
}

type GetVersionDepsParams

type GetVersionDepsParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
}

type GetVersionFilesParams

type GetVersionFilesParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
}

type GetVersionParams

type GetVersionParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
}

type InsertVersionDepParams

type InsertVersionDepParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
	DepSchemaID string `json:"dep_schema_id"`
	DepFilename string `json:"dep_filename"`
	DepVersion  int64  `json:"dep_version"`
}

type InsertVersionFileParams

type InsertVersionFileParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
	Filename    string `json:"filename"`
	BlobSha256  string `json:"blob_sha256"`
}

type InsertVersionParams

type InsertVersionParams struct {
	NamespaceID     string `json:"namespace_id"`
	SchemaID        string `json:"schema_id"`
	Version         int64  `json:"version"`
	Compiled        []byte `json:"compiled"`
	CompilerVersion string `json:"compiler_version"`
	CreatedBy       string `json:"created_by"`
	Metadata        []byte `json:"metadata"`
}

type ListNamespacesPageParams

type ListNamespacesPageParams struct {
	ID    string `json:"id"`
	Limit int32  `json:"limit"`
}

type ListSchemasPageParams

type ListSchemasPageParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Limit       int32  `json:"limit"`
}

type ListVersionsParams

type ListVersionsParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
}

type LoadAllCurrentRow

type LoadAllCurrentRow struct {
	NamespaceID     string `json:"namespace_id"`
	SchemaID        string `json:"schema_id"`
	Version         int64  `json:"version"`
	Compiled        []byte `json:"compiled"`
	CompilerVersion string `json:"compiler_version"`
	Filename        string `json:"filename"`
	BlobSha256      string `json:"blob_sha256"`
}

type LoadNamespaceCurrentRow

type LoadNamespaceCurrentRow struct {
	NamespaceID     string `json:"namespace_id"`
	SchemaID        string `json:"schema_id"`
	Version         int64  `json:"version"`
	Compiled        []byte `json:"compiled"`
	CompilerVersion string `json:"compiler_version"`
	Filename        string `json:"filename"`
	BlobSha256      string `json:"blob_sha256"`
}

type LoadNamespaceProposedRow

type LoadNamespaceProposedRow struct {
	NamespaceID     string `json:"namespace_id"`
	SchemaID        string `json:"schema_id"`
	Version         int64  `json:"version"`
	Compiled        []byte `json:"compiled"`
	CompilerVersion string `json:"compiler_version"`
	Filename        string `json:"filename"`
	BlobSha256      string `json:"blob_sha256"`
}

type Namespace

type Namespace struct {
	ID        string             `json:"id"`
	CreatedAt time.Time          `json:"created_at"`
	DeletedAt pgtype.Timestamptz `json:"deleted_at"`
	Metadata  []byte             `json:"metadata"`
}

type PromoteAllStagedRow

type PromoteAllStagedRow struct {
	SchemaID       string      `json:"schema_id"`
	CurrentVersion pgtype.Int8 `json:"current_version"`
}

type ProtoBlob

type ProtoBlob struct {
	NamespaceID    string    `json:"namespace_id"`
	Sha256         string    `json:"sha256"`
	OriginalSource []byte    `json:"original_source"`
	SizeBytes      int32     `json:"size_bytes"`
	CreatedAt      time.Time `json:"created_at"`
}

type PutBlobParams

type PutBlobParams struct {
	NamespaceID    string `json:"namespace_id"`
	Sha256         string `json:"sha256"`
	OriginalSource []byte `json:"original_source"`
	SizeBytes      int32  `json:"size_bytes"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ClearStagedVersion

func (q *Queries) ClearStagedVersion(ctx context.Context, arg ClearStagedVersionParams) error

func (*Queries) CreateNamespace

func (q *Queries) CreateNamespace(ctx context.Context, arg CreateNamespaceParams) error

func (*Queries) CreateSchema

func (q *Queries) CreateSchema(ctx context.Context, arg CreateSchemaParams) error

func (*Queries) DiscardAllStaged

func (q *Queries) DiscardAllStaged(ctx context.Context, namespaceID string) error

func (*Queries) GetBlob

func (q *Queries) GetBlob(ctx context.Context, arg GetBlobParams) (ProtoBlob, error)

func (*Queries) GetBlobsByHashes

func (q *Queries) GetBlobsByHashes(ctx context.Context, arg GetBlobsByHashesParams) ([]ProtoBlob, error)

func (*Queries) GetDependents

func (q *Queries) GetDependents(ctx context.Context, arg GetDependentsParams) ([]GetDependentsRow, error)

func (*Queries) GetNamespace

func (q *Queries) GetNamespace(ctx context.Context, id string) (Namespace, error)

func (*Queries) GetSchema

func (q *Queries) GetSchema(ctx context.Context, arg GetSchemaParams) (Schema, error)

func (*Queries) GetSchemaForUpdate

func (q *Queries) GetSchemaForUpdate(ctx context.Context, arg GetSchemaForUpdateParams) (Schema, error)

func (*Queries) GetStagedSchemas

func (q *Queries) GetStagedSchemas(ctx context.Context, namespaceID string) ([]Schema, error)

func (*Queries) GetVersion

func (q *Queries) GetVersion(ctx context.Context, arg GetVersionParams) (SchemaVersion, error)

func (*Queries) GetVersionDeps

func (q *Queries) GetVersionDeps(ctx context.Context, arg GetVersionDepsParams) ([]SchemaVersionDep, error)

func (*Queries) GetVersionFiles

func (q *Queries) GetVersionFiles(ctx context.Context, arg GetVersionFilesParams) ([]SchemaVersionFile, error)

func (*Queries) InsertVersion

func (q *Queries) InsertVersion(ctx context.Context, arg InsertVersionParams) error

func (*Queries) InsertVersionDep

func (q *Queries) InsertVersionDep(ctx context.Context, arg InsertVersionDepParams) error

func (*Queries) InsertVersionFile

func (q *Queries) InsertVersionFile(ctx context.Context, arg InsertVersionFileParams) error

func (*Queries) ListNamespaces

func (q *Queries) ListNamespaces(ctx context.Context) ([]Namespace, error)

func (*Queries) ListNamespacesPage

func (q *Queries) ListNamespacesPage(ctx context.Context, arg ListNamespacesPageParams) ([]Namespace, error)

ListNamespacesPage returns at most $2 namespaces whose id is strictly greater than $1, ordered by id. Pass an empty string for $1 to start at the beginning. Keyset pagination: stable under concurrent inserts/deletes.

func (*Queries) ListSchemas

func (q *Queries) ListSchemas(ctx context.Context, namespaceID string) ([]Schema, error)

func (*Queries) ListSchemasPage

func (q *Queries) ListSchemasPage(ctx context.Context, arg ListSchemasPageParams) ([]Schema, error)

ListSchemasPage is the keyset-paginated variant. Returns at most $3 schemas in the namespace whose schema_id is strictly greater than $2, ordered by schema_id. Pass an empty string for $2 to start at the beginning.

func (*Queries) ListVersions

func (q *Queries) ListVersions(ctx context.Context, arg ListVersionsParams) ([]int64, error)

func (*Queries) LoadAllCurrent

func (q *Queries) LoadAllCurrent(ctx context.Context) ([]LoadAllCurrentRow, error)

func (*Queries) LoadNamespaceCurrent

func (q *Queries) LoadNamespaceCurrent(ctx context.Context, namespaceID string) ([]LoadNamespaceCurrentRow, error)

func (*Queries) LoadNamespaceProposed

func (q *Queries) LoadNamespaceProposed(ctx context.Context, namespaceID string) ([]LoadNamespaceProposedRow, error)

func (*Queries) PromoteAllStaged

func (q *Queries) PromoteAllStaged(ctx context.Context, namespaceID string) ([]PromoteAllStagedRow, error)

func (*Queries) PutBlob

func (q *Queries) PutBlob(ctx context.Context, arg PutBlobParams) error

func (*Queries) SetCurrentVersion

func (q *Queries) SetCurrentVersion(ctx context.Context, arg SetCurrentVersionParams) error

func (*Queries) SetStagedVersion

func (q *Queries) SetStagedVersion(ctx context.Context, arg SetStagedVersionParams) error

func (*Queries) SoftDeleteNamespace

func (q *Queries) SoftDeleteNamespace(ctx context.Context, id string) error

func (*Queries) SoftDeleteSchema

func (q *Queries) SoftDeleteSchema(ctx context.Context, arg SoftDeleteSchemaParams) error

func (*Queries) SoftDeleteVersion

func (q *Queries) SoftDeleteVersion(ctx context.Context, arg SoftDeleteVersionParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Schema

type Schema struct {
	NamespaceID    string             `json:"namespace_id"`
	SchemaID       string             `json:"schema_id"`
	CurrentVersion pgtype.Int8        `json:"current_version"`
	StagedVersion  pgtype.Int8        `json:"staged_version"`
	CreatedAt      time.Time          `json:"created_at"`
	DeletedAt      pgtype.Timestamptz `json:"deleted_at"`
	Metadata       []byte             `json:"metadata"`
}

type SchemaVersion

type SchemaVersion struct {
	NamespaceID     string             `json:"namespace_id"`
	SchemaID        string             `json:"schema_id"`
	Version         int64              `json:"version"`
	Compiled        []byte             `json:"compiled"`
	CompilerVersion string             `json:"compiler_version"`
	CreatedAt       time.Time          `json:"created_at"`
	CreatedBy       string             `json:"created_by"`
	DeletedAt       pgtype.Timestamptz `json:"deleted_at"`
	Metadata        []byte             `json:"metadata"`
}

type SchemaVersionDep

type SchemaVersionDep struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
	DepSchemaID string `json:"dep_schema_id"`
	DepFilename string `json:"dep_filename"`
	DepVersion  int64  `json:"dep_version"`
}

type SchemaVersionFile

type SchemaVersionFile struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
	Filename    string `json:"filename"`
	BlobSha256  string `json:"blob_sha256"`
}

type SetCurrentVersionParams

type SetCurrentVersionParams struct {
	NamespaceID    string      `json:"namespace_id"`
	SchemaID       string      `json:"schema_id"`
	CurrentVersion pgtype.Int8 `json:"current_version"`
}

type SetStagedVersionParams

type SetStagedVersionParams struct {
	NamespaceID   string      `json:"namespace_id"`
	SchemaID      string      `json:"schema_id"`
	StagedVersion pgtype.Int8 `json:"staged_version"`
}

type SoftDeleteSchemaParams

type SoftDeleteSchemaParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
}

type SoftDeleteVersionParams

type SoftDeleteVersionParams struct {
	NamespaceID string `json:"namespace_id"`
	SchemaID    string `json:"schema_id"`
	Version     int64  `json:"version"`
}

Jump to

Keyboard shortcuts

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