Documentation ¶
Index ¶
Constants ¶
View Source
const (
FO_Open string = "open"
)
FileDbObject.Status mapping
Variables ¶
This section is empty.
Functions ¶
func AppendDataRow ¶
Transform a struct into json and then back into a row (array of interface{}) to insert into database using api
func DataTypeFromOID ¶
Utilities for converting postgres oid to data types see pgx/pgtype/pgtype.go https://github.com/jackc/pgx/blob/572d7fff326f1befdbf9f36a0c0a2b6661432079/pgtype/pgtype.go
func IsArrayFromOID ¶
Types ¶
type FileDbObject ¶
type FileDbObject struct { Key int `json:"key"` WorkspaceName string `json:"workspace_name"` Oid uint32 `json:"oid"` FileName string `json:"file_name"` ContentType string `json:"content_type"` Status string `json:"status"` UserEmail string `json:"user_email"` }
func QueryFileObject ¶
func QueryFileObject(dbpool *pgxpool.Pool, workspaceName, status, contentType string) ([]*FileDbObject, error)
Query workspace_changes table for rows by workspace_name, status, and optionally content_type (if not empty)
func (*FileDbObject) ReadObject ¶
Case fo.Oid == 0:
Expect to have fo.WorkspaceName and fo.FileName available (alternatively could use fo.Key in future) Returns fo with Oid, ContentType, Status, and UserEmail populated and write the object in fd
Case fo.Oid != 0:
Write the object in fd. Does not change fo.
func (*FileDbObject) UpdateFileObject ¶
func (fo *FileDbObject) UpdateFileObject(txWrite pgx.Tx, ctx context.Context) error
func (*FileDbObject) WriteObject ¶
Insert the content of fd into database with metadata specified by fo Expect to have fo.workspace_name and fo.file_name available Will populate fo.Oid and fo.Key
Click to show internal directories.
Click to hide internal directories.