database

package
v0.0.0-...-f4df796 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 8 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructPostgresDSN

func ConstructPostgresDSN(host, user, password, dbname, port, sslmode, timezone string) string

ConstructPostgresDSN constructs the Data Source Name for a PostgreSQL connection

func GetPostgresClient

func GetPostgresClient(dsn string) (*gorm.DB, error)

GetPostgresClient initializes or returns a database connection for a given DSN

Types

type CodeEmbedding

type CodeEmbedding struct {
	URL        string `gorm:"primaryKey;type:varchar(255)"`
	FileHash   string `gorm:"primaryKey;type:varchar(255)"`
	FilePath   string `gorm:"primaryKey;type:varchar(255)"`
	ChunkID    int    `gorm:"primaryKey"`
	StartIndex int
	EndIndex   int
	Embedding  pgvector.Vector `gorm:"type:vector(768)"`
}

type Config

type Config struct {
	URL  string `gorm:"primaryKey;type:varchar(255)"`
	Blob []byte
}

type Index

type Index struct {
	URL  string `gorm:"primaryKey;type:varchar(255)"`
	Blob []byte
}

type Object

type Object struct {
	Hash string `gorm:"primaryKey;type:varchar(255)"`
	Type string `gorm:"type:varchar(255)"`
	Blob []byte
	Size int64  `gorm:"type:bigint"`
	URL  string `gorm:"primaryKey;type:varchar(255)"`
}

type Reference

type Reference struct {
	Name   string `gorm:"primaryKey;type:varchar(255)"`
	Type   string `gorm:"type:varchar(255)"`
	Target string `gorm:"type:varchar(255)"`
	Hash   string `gorm:"type:varchar(255)"`
	URL    string `gorm:"primaryKey;type:varchar(255)"`
}

type Shallow

type Shallow struct {
	URL    string         `gorm:"primaryKey;type:varchar(255)"`
	Hashes pq.StringArray `gorm:"type:text[]"`
}

Jump to

Keyboard shortcuts

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