db

package
v0.0.0-...-927a41b Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateLink               = `INSERT INTO links (original_url, short_code, creator_ip_address) VALUES ($1, $2, $3)`
	GetLinkByShortCode       = `SELECT * from links WHERE short_code = $1`
	ToggleLinkEnabledState   = `UPDATE links SET enabled = NOT enabled, updated_at = NOW() WHERE short_code = $1`
	UpdateShortendLinkURL    = `UPDATE links SET original_url = $1, updated_at = NOW() WHERE short_code = $2`
	UpdateVisitAndReturnLink = `UPDATE links SET visits = visits + 1 WHERE short_code = $1 RETURNING *`
)

Variables

This section is empty.

Functions

func CreatePostgresConnection

func CreatePostgresConnection() *sqlx.DB

func CreateRedisClient

func CreateRedisClient() *redis.Client

Types

This section is empty.

Jump to

Keyboard shortcuts

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