db

package
v0.0.0-...-29afaea Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CommunicationTypes []CommunicationType
	EntityTypes        []EntityType
	RelationshipTypes  []RelationshipType
)

Functions

func Seed

func Seed(ctx context.Context, db *sql.DB, q *Queries) error

Types

type Attribute

type Attribute struct {
	AttributeID     int64
	EntityID        int64
	AttributeTypeID int64
	AttributeValue  string
}

type AttributeType

type AttributeType struct {
	AttributeTypeID   int64
	AttributeTypeName string
}

type Communication

type Communication struct {
	CommunicationID          int64
	EntityID                 int64
	CommunicationName        string
	CommunicationDestination string
	CommunicationTypeID      int64
}

type CommunicationType

type CommunicationType struct {
	CommunicationTypeID   int64
	CommunicationTypeName string
}

type CreateEntityParams

type CreateEntityParams struct {
	EntityTypeID int64
	EntityName   string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Entity

type Entity struct {
	EntityID     int64
	EntityName   string
	EntityTypeID int64
}

type EntityType

type EntityType struct {
	EntityTypeID   int64
	EntityTypeName string
}

type GetEntityByIDRow

type GetEntityByIDRow struct {
	EntityID       int64
	EntityName     string
	EntityTypeID   int64
	EntityTypeName string
}

type GetEntityByNameRow

type GetEntityByNameRow struct {
	EntityID       int64
	EntityName     string
	EntityTypeID   int64
	EntityTypeName string
}

type ListAttributesByEntityIDRow

type ListAttributesByEntityIDRow struct {
	AttributeID       int64
	EntityID          int64
	AttributeTypeID   int64
	AttributeValue    string
	AttributeTypeName string
}

type ListChildrenEntitiesParams

type ListChildrenEntitiesParams struct {
	EntityID int64
	Offset   int64
	Limit    int64
}

type ListChildrenEntitiesRow

type ListChildrenEntitiesRow struct {
	RelationshipID       int64
	SourceEntityID       int64
	TargetEntityID       int64
	RelationshipTypeID   int64
	RelationshipTypeName string
	EntityName           string
	EntityTypeName       string
}

type ListEntitiesByTypeParams

type ListEntitiesByTypeParams struct {
	EntityTypeID int64
	Offset       int64
	Limit        int64
}

type ListEntitiesByTypeRow

type ListEntitiesByTypeRow struct {
	EntityID       int64
	EntityName     string
	EntityTypeID   int64
	EntityTypeName string
}

type ListEntitiesParams

type ListEntitiesParams struct {
	Offset int64
	Limit  int64
}

type ListEntitiesRow

type ListEntitiesRow struct {
	EntityID       int64
	EntityName     string
	EntityTypeID   int64
	EntityTypeName string
}

type ListParentEntitiesParams

type ListParentEntitiesParams struct {
	EntityID int64
	Offset   int64
	Limit    int64
}

type ListParentEntitiesRow

type ListParentEntitiesRow struct {
	RelationshipID       int64
	SourceEntityID       int64
	TargetEntityID       int64
	RelationshipTypeID   int64
	RelationshipTypeName string
	EntityName           string
	EntityTypeName       string
}

type ListRelationshipsParams

type ListRelationshipsParams struct {
	Offset int64
	Limit  int64
}

type ListRelationshipsRow

type ListRelationshipsRow struct {
	RelationshipID       int64
	SourceEntityID       int64
	TargetEntityID       int64
	RelationshipTypeID   int64
	RelationshipTypeName string
	SourceEntityName     string
	SourceEntityTypeName string
	TargetEntityName     string
	TargetEntityTypeName string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateEntity

func (q *Queries) CreateEntity(ctx context.Context, arg CreateEntityParams) (Entity, error)

func (*Queries) DeleteEntity

func (q *Queries) DeleteEntity(ctx context.Context, entityID int64) error

func (*Queries) GetEntityByID

func (q *Queries) GetEntityByID(ctx context.Context, entityID int64) (GetEntityByIDRow, error)

func (*Queries) GetEntityByName

func (q *Queries) GetEntityByName(ctx context.Context, entityName string) (GetEntityByNameRow, error)

func (*Queries) ListAttributeTypes

func (q *Queries) ListAttributeTypes(ctx context.Context) ([]AttributeType, error)

func (*Queries) ListAttributesByEntityID

func (q *Queries) ListAttributesByEntityID(ctx context.Context, entityID int64) ([]ListAttributesByEntityIDRow, error)

func (*Queries) ListChildrenEntities

func (q *Queries) ListChildrenEntities(ctx context.Context, arg ListChildrenEntitiesParams) ([]ListChildrenEntitiesRow, error)

func (*Queries) ListCommunicationTypes

func (q *Queries) ListCommunicationTypes(ctx context.Context) ([]CommunicationType, error)

func (*Queries) ListEntities

func (q *Queries) ListEntities(ctx context.Context, arg ListEntitiesParams) ([]ListEntitiesRow, error)

func (*Queries) ListEntitiesByType

func (q *Queries) ListEntitiesByType(ctx context.Context, arg ListEntitiesByTypeParams) ([]ListEntitiesByTypeRow, error)

func (*Queries) ListEntityTypes

func (q *Queries) ListEntityTypes(ctx context.Context) ([]EntityType, error)

func (*Queries) ListParentEntities

func (q *Queries) ListParentEntities(ctx context.Context, arg ListParentEntitiesParams) ([]ListParentEntitiesRow, error)

func (*Queries) ListRelationshipTypes

func (q *Queries) ListRelationshipTypes(ctx context.Context) ([]RelationshipType, error)

func (*Queries) ListRelationships

func (q *Queries) ListRelationships(ctx context.Context, arg ListRelationshipsParams) ([]ListRelationshipsRow, error)

func (*Queries) SeedAttributeTypes

func (q *Queries) SeedAttributeTypes(ctx context.Context) error

func (*Queries) SeedCommunicationTypes

func (q *Queries) SeedCommunicationTypes(ctx context.Context) error

func (*Queries) SeedEntityTypes

func (q *Queries) SeedEntityTypes(ctx context.Context) error

func (*Queries) SeedRelationshipTypes

func (q *Queries) SeedRelationshipTypes(ctx context.Context) error

func (*Queries) UpdateEntityName

func (q *Queries) UpdateEntityName(ctx context.Context, arg UpdateEntityNameParams) (Entity, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Relationship

type Relationship struct {
	RelationshipID     int64
	SourceEntityID     int64
	TargetEntityID     int64
	RelationshipTypeID int64
}

type RelationshipType

type RelationshipType struct {
	RelationshipTypeID   int64
	RelationshipTypeName string
}

type SourceEntity

type SourceEntity struct {
	EntityID     int64
	EntityName   string
	EntityTypeID int64
}

type SourceEntityType

type SourceEntityType struct {
	EntityTypeID   int64
	EntityTypeName string
}

type TargetEntity

type TargetEntity struct {
	EntityID     int64
	EntityName   string
	EntityTypeID int64
}

type TargetEntityType

type TargetEntityType struct {
	EntityTypeID   int64
	EntityTypeName string
}

type UpdateEntityNameParams

type UpdateEntityNameParams struct {
	EntityName string
	EntityID   int64
}

Jump to

Keyboard shortcuts

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