{"modulePath":"github.com/encoder-run/operator","version":"v0.0.0-20240524211239-f4df79696082","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package database\n\n## Functions\n\n```go\nfunc ConstructPostgresDSN(host, user, password, dbname, port, sslmode, timezone string) string\n```\nConstructPostgresDSN constructs the Data Source Name for a PostgreSQL connection\n\n```go\nfunc GetPostgresClient(dsn string) (*gorm.DB, error)\n```\nGetPostgresClient initializes or returns a database connection for a given DSN\n\n## Types\n\n```go\ntype CodeEmbedding struct {\n\tURL        string `gorm:\"primaryKey;type:varchar(255)\"`\n\tFileHash   string `gorm:\"primaryKey;type:varchar(255)\"`\n\tFilePath   string `gorm:\"primaryKey;type:varchar(255)\"`\n\tChunkID    int    `gorm:\"primaryKey\"`\n\tStartIndex int\n\tEndIndex   int\n\tEmbedding  pgvector.Vector `gorm:\"type:vector(768)\"`\n}\n```\n\n```go\ntype Config struct {\n\tURL  string `gorm:\"primaryKey;type:varchar(255)\"`\n\tBlob []byte\n}\n```\n\n```go\ntype Index struct {\n\tURL  string `gorm:\"primaryKey;type:varchar(255)\"`\n\tBlob []byte\n}\n```\n\n```go\ntype Object struct {\n\tHash string `gorm:\"primaryKey;type:varchar(255)\"`\n\tType string `gorm:\"type:varchar(255)\"`\n\tBlob []byte\n\tSize int64  `gorm:\"type:bigint\"`\n\tURL  string `gorm:\"primaryKey;type:varchar(255)\"`\n}\n```\n\n```go\ntype Reference struct {\n\tName   string `gorm:\"primaryKey;type:varchar(255)\"`\n\tType   string `gorm:\"type:varchar(255)\"`\n\tTarget string `gorm:\"type:varchar(255)\"`\n\tHash   string `gorm:\"type:varchar(255)\"`\n\tURL    string `gorm:\"primaryKey;type:varchar(255)\"`\n}\n```\n\n```go\ntype Shallow struct {\n\tURL    string         `gorm:\"primaryKey;type:varchar(255)\"`\n\tHashes pq.StringArray `gorm:\"type:text[]\"`\n}\n```\n\n","path":"github.com/encoder-run/operator/pkg/database","name":"database","synopsis":"","isRedistributable":true}
