queries

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

nolint

nolint

Index

Constants

View Source
const (
	AddVerifyUser    = `insert into verify_emails (token,user_id) values ($1,$2);`
	GetVerifyUser    = `select user_id from verify_emails where token=$1;`
	DeleteVerifyUser = `delete from verify_emails where token=$1;`
)

Variables

View Source
var (
	SetImageManifest = `` /* 182-byte string literal not displayed */

	SetLayer = `` /* 181-byte string literal not displayed */

	// SetBlob TODO - (guacamole/jay-dee7) find a better way to handle duplicates in blob
	SetBlob = `` /* 143-byte string literal not displayed */

	SetConfig = `` /* 264-byte string literal not displayed */

)

insert queries

View Source
var (
	GetDigest                    = `select digest from layers where digest=$1;`
	ReadMetadata                 = `select * from metadata where namespace=$1;`
	GetLayer                     = `select * from layer where digest=$1;`
	GetContentHashById           = `select sky_link from layer where uuid=$1;`
	GetManifest                  = `select * from image_manifest where namespace=$1;`
	GetBlob                      = `select * from blob where digest=$1;`
	GetConfig                    = `select * from config where namespace=$1;`
	GetImageTags                 = `select reference from config where namespace=$1;`
	GetManifestByRef             = `select * from config where namespace=$1 and reference=$2;`
	GetManifestByDig             = `select * from config where namespace=$1 and digest=$2;`
	GetCatalogCount              = `select count(namespace) from image_manifest;`
	GetUserCatalogCount          = `select count(namespace) from image_manifest where namespace like $1;`
	GetCatalog                   = `select namespace from image_manifest;`
	GetCatalogWithPagination     = `select namespace from image_manifest limit $1 offset $2;`
	GetUserCatalogWithPagination = `select namespace from image_manifest where namespace like $1 limit $2 offset $3;`
	GetImageNamespace            = `` /* 132-byte string literal not displayed */

	// be very careful using this one
	GetCatalogDetailWithPagination     = `select namespace,created_at::timestamptz,updated_at::timestamptz from image_manifest order by %s limit $1 offset $2;`
	GetUserCatalogDetailWithPagination = `` /* 143-byte string literal not displayed */

	GetRepoDetailWithPagination = `` /* 207-byte string literal not displayed */

)

select queries

View Source
var (
	DeleteLayer         = `delete from layer where digest=$1;`
	DeleteBlob          = `delete from blob where digest=$1;`
	DeleteManifestByRef = `delete from config where reference=$1;`
	DeleteManifestByDig = `delete from config where digest=$1;`
)

delete queries

View Source
var (
	AddUser = `` /* 160-byte string literal not displayed */

	GetUser                 = `select id, is_active, username, email, created_at, updated_at from users where email=$1 or username=$1;`
	GetUserWithPassword     = `select id, is_active, username, email, password, created_at, updated_at from users where email=$1 or username=$1;`
	GetUserById             = `select id, is_active, username, email, created_at, updated_at from users where id=$1;`
	GetUserByIdWithPassword = `select id, is_active, username, email, password, created_at, updated_at from users where id=$1;`
	GetUserWithSession      = `` /* 148-byte string literal not displayed */
	UpdateUser              = `update users set is_active = $1, updated_at = $2 where id = $3;`
	SetUserActive           = `update users set is_active=true where id=$1`
	DeleteUser              = `delete from users where username = $1;`
	UpdateUserPwd           = `update users set password=$1 where id=$2;`
	GetAllEmails            = `select email from users;`
	AddOAuthUser            = `` /* 297-byte string literal not displayed */

)
View Source
var (
	AddSession        = `insert into session (id,refresh_token,owner) values($1, $2, (select id from users where username=$3));`
	GetSession        = `select id,refresh_token,owner from session where id=$1;`
	DeleteSession     = `delete from session where id=$1 and owner=$2;`
	DeleteAllSessions = `delete from session where owner=$1;`
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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