document

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the document type in the database.
	Label = "document"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldMetadataID holds the string denoting the metadata_id field in the database.
	FieldMetadataID = "metadata_id"
	// FieldNodeListID holds the string denoting the node_list_id field in the database.
	FieldNodeListID = "node_list_id"
	// EdgeAnnotations holds the string denoting the annotations edge name in mutations.
	EdgeAnnotations = "annotations"
	// EdgeMetadata holds the string denoting the metadata edge name in mutations.
	EdgeMetadata = "metadata"
	// EdgeNodeList holds the string denoting the node_list edge name in mutations.
	EdgeNodeList = "node_list"
	// EdgeDocumentTypes holds the string denoting the document_types edge name in mutations.
	EdgeDocumentTypes = "document_types"
	// EdgeEdgeTypes holds the string denoting the edge_types edge name in mutations.
	EdgeEdgeTypes = "edge_types"
	// EdgeExternalReferences holds the string denoting the external_references edge name in mutations.
	EdgeExternalReferences = "external_references"
	// EdgeHashes holds the string denoting the hashes edge name in mutations.
	EdgeHashes = "hashes"
	// EdgeIdentifiers holds the string denoting the identifiers edge name in mutations.
	EdgeIdentifiers = "identifiers"
	// EdgeNodes holds the string denoting the nodes edge name in mutations.
	EdgeNodes = "nodes"
	// EdgePersons holds the string denoting the persons edge name in mutations.
	EdgePersons = "persons"
	// EdgeProperties holds the string denoting the properties edge name in mutations.
	EdgeProperties = "properties"
	// EdgePurposes holds the string denoting the purposes edge name in mutations.
	EdgePurposes = "purposes"
	// EdgeSourceData holds the string denoting the source_data edge name in mutations.
	EdgeSourceData = "source_data"
	// EdgeTools holds the string denoting the tools edge name in mutations.
	EdgeTools = "tools"
	// Table holds the table name of the document in the database.
	Table = "documents"
	// AnnotationsTable is the table that holds the annotations relation/edge.
	AnnotationsTable = "annotations"
	// AnnotationsInverseTable is the table name for the Annotation entity.
	// It exists in this package in order to avoid circular dependency with the "annotation" package.
	AnnotationsInverseTable = "annotations"
	// AnnotationsColumn is the table column denoting the annotations relation/edge.
	AnnotationsColumn = "document_id"
	// MetadataTable is the table that holds the metadata relation/edge.
	MetadataTable = "documents"
	// MetadataInverseTable is the table name for the Metadata entity.
	// It exists in this package in order to avoid circular dependency with the "metadata" package.
	MetadataInverseTable = "metadata"
	// MetadataColumn is the table column denoting the metadata relation/edge.
	MetadataColumn = "metadata_id"
	// NodeListTable is the table that holds the node_list relation/edge.
	NodeListTable = "documents"
	// NodeListInverseTable is the table name for the NodeList entity.
	// It exists in this package in order to avoid circular dependency with the "nodelist" package.
	NodeListInverseTable = "node_lists"
	// NodeListColumn is the table column denoting the node_list relation/edge.
	NodeListColumn = "node_list_id"
	// DocumentTypesTable is the table that holds the document_types relation/edge. The primary key declared below.
	DocumentTypesTable = "document_document_types"
	// DocumentTypesInverseTable is the table name for the DocumentType entity.
	// It exists in this package in order to avoid circular dependency with the "documenttype" package.
	DocumentTypesInverseTable = "document_types"
	// EdgeTypesTable is the table that holds the edge_types relation/edge. The primary key declared below.
	EdgeTypesTable = "document_edge_types"
	// EdgeTypesInverseTable is the table name for the EdgeType entity.
	// It exists in this package in order to avoid circular dependency with the "edgetype" package.
	EdgeTypesInverseTable = "edge_types"
	// ExternalReferencesTable is the table that holds the external_references relation/edge. The primary key declared below.
	ExternalReferencesTable = "document_external_references"
	// ExternalReferencesInverseTable is the table name for the ExternalReference entity.
	// It exists in this package in order to avoid circular dependency with the "externalreference" package.
	ExternalReferencesInverseTable = "external_references"
	// HashesTable is the table that holds the hashes relation/edge. The primary key declared below.
	HashesTable = "document_hashes"
	// HashesInverseTable is the table name for the HashesEntry entity.
	// It exists in this package in order to avoid circular dependency with the "hashesentry" package.
	HashesInverseTable = "hashes_entries"
	// IdentifiersTable is the table that holds the identifiers relation/edge. The primary key declared below.
	IdentifiersTable = "document_identifiers"
	// IdentifiersInverseTable is the table name for the IdentifiersEntry entity.
	// It exists in this package in order to avoid circular dependency with the "identifiersentry" package.
	IdentifiersInverseTable = "identifiers_entries"
	// NodesTable is the table that holds the nodes relation/edge. The primary key declared below.
	NodesTable = "document_nodes"
	// NodesInverseTable is the table name for the Node entity.
	// It exists in this package in order to avoid circular dependency with the "node" package.
	NodesInverseTable = "nodes"
	// PersonsTable is the table that holds the persons relation/edge. The primary key declared below.
	PersonsTable = "document_persons"
	// PersonsInverseTable is the table name for the Person entity.
	// It exists in this package in order to avoid circular dependency with the "person" package.
	PersonsInverseTable = "persons"
	// PropertiesTable is the table that holds the properties relation/edge. The primary key declared below.
	PropertiesTable = "document_properties"
	// PropertiesInverseTable is the table name for the Property entity.
	// It exists in this package in order to avoid circular dependency with the "property" package.
	PropertiesInverseTable = "properties"
	// PurposesTable is the table that holds the purposes relation/edge. The primary key declared below.
	PurposesTable = "document_purposes"
	// PurposesInverseTable is the table name for the Purpose entity.
	// It exists in this package in order to avoid circular dependency with the "purpose" package.
	PurposesInverseTable = "purposes"
	// SourceDataTable is the table that holds the source_data relation/edge. The primary key declared below.
	SourceDataTable = "document_source_data"
	// SourceDataInverseTable is the table name for the SourceData entity.
	// It exists in this package in order to avoid circular dependency with the "sourcedata" package.
	SourceDataInverseTable = "source_data"
	// ToolsTable is the table that holds the tools relation/edge. The primary key declared below.
	ToolsTable = "document_tools"
	// ToolsInverseTable is the table name for the Tool entity.
	// It exists in this package in order to avoid circular dependency with the "tool" package.
	ToolsInverseTable = "tools"
)

Variables

View Source
var (
	// DocumentTypesPrimaryKey and DocumentTypesColumn2 are the table columns denoting the
	// primary key for the document_types relation (M2M).
	DocumentTypesPrimaryKey = []string{"document_id", "document_type_id"}
	// EdgeTypesPrimaryKey and EdgeTypesColumn2 are the table columns denoting the
	// primary key for the edge_types relation (M2M).
	EdgeTypesPrimaryKey = []string{"document_id", "edge_type_id"}
	// ExternalReferencesPrimaryKey and ExternalReferencesColumn2 are the table columns denoting the
	// primary key for the external_references relation (M2M).
	ExternalReferencesPrimaryKey = []string{"document_id", "external_reference_id"}
	// HashesPrimaryKey and HashesColumn2 are the table columns denoting the
	// primary key for the hashes relation (M2M).
	HashesPrimaryKey = []string{"document_id", "hashes_entry_id"}
	// IdentifiersPrimaryKey and IdentifiersColumn2 are the table columns denoting the
	// primary key for the identifiers relation (M2M).
	IdentifiersPrimaryKey = []string{"document_id", "identifiers_entry_id"}
	// NodesPrimaryKey and NodesColumn2 are the table columns denoting the
	// primary key for the nodes relation (M2M).
	NodesPrimaryKey = []string{"document_id", "node_id"}
	// PersonsPrimaryKey and PersonsColumn2 are the table columns denoting the
	// primary key for the persons relation (M2M).
	PersonsPrimaryKey = []string{"document_id", "person_id"}
	// PropertiesPrimaryKey and PropertiesColumn2 are the table columns denoting the
	// primary key for the properties relation (M2M).
	PropertiesPrimaryKey = []string{"document_id", "property_id"}
	// PurposesPrimaryKey and PurposesColumn2 are the table columns denoting the
	// primary key for the purposes relation (M2M).
	PurposesPrimaryKey = []string{"document_id", "purpose_id"}
	// SourceDataPrimaryKey and SourceDataColumn2 are the table columns denoting the
	// primary key for the source_data relation (M2M).
	SourceDataPrimaryKey = []string{"document_id", "source_data_id"}
	// ToolsPrimaryKey and ToolsColumn2 are the table columns denoting the
	// primary key for the tools relation (M2M).
	ToolsPrimaryKey = []string{"document_id", "tool_id"}
)
View Source
var (
	Hooks [1]ent.Hook
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

Note that the variables below are initialized by the runtime package on the initialization of the application. Therefore, it should be imported in the main as follows:

import _ "github.com/protobom/storage/internal/backends/ent/runtime"

Columns holds all SQL columns for document fields.

Functions

func And

func And(predicates ...predicate.Document) predicate.Document

And groups predicates with the AND operator between them.

func HasAnnotations added in v0.1.4

func HasAnnotations() predicate.Document

HasAnnotations applies the HasEdge predicate on the "annotations" edge.

func HasAnnotationsWith added in v0.1.4

func HasAnnotationsWith(preds ...predicate.Annotation) predicate.Document

HasAnnotationsWith applies the HasEdge predicate on the "annotations" edge with a given conditions (other predicates).

func HasDocumentTypes added in v0.2.0

func HasDocumentTypes() predicate.Document

HasDocumentTypes applies the HasEdge predicate on the "document_types" edge.

func HasDocumentTypesWith added in v0.2.0

func HasDocumentTypesWith(preds ...predicate.DocumentType) predicate.Document

HasDocumentTypesWith applies the HasEdge predicate on the "document_types" edge with a given conditions (other predicates).

func HasEdgeTypes added in v0.2.0

func HasEdgeTypes() predicate.Document

HasEdgeTypes applies the HasEdge predicate on the "edge_types" edge.

func HasEdgeTypesWith added in v0.2.0

func HasEdgeTypesWith(preds ...predicate.EdgeType) predicate.Document

HasEdgeTypesWith applies the HasEdge predicate on the "edge_types" edge with a given conditions (other predicates).

func HasExternalReferences added in v0.2.0

func HasExternalReferences() predicate.Document

HasExternalReferences applies the HasEdge predicate on the "external_references" edge.

func HasExternalReferencesWith added in v0.2.0

func HasExternalReferencesWith(preds ...predicate.ExternalReference) predicate.Document

HasExternalReferencesWith applies the HasEdge predicate on the "external_references" edge with a given conditions (other predicates).

func HasHashes added in v0.2.0

func HasHashes() predicate.Document

HasHashes applies the HasEdge predicate on the "hashes" edge.

func HasHashesWith added in v0.2.0

func HasHashesWith(preds ...predicate.HashesEntry) predicate.Document

HasHashesWith applies the HasEdge predicate on the "hashes" edge with a given conditions (other predicates).

func HasIdentifiers added in v0.2.0

func HasIdentifiers() predicate.Document

HasIdentifiers applies the HasEdge predicate on the "identifiers" edge.

func HasIdentifiersWith added in v0.2.0

func HasIdentifiersWith(preds ...predicate.IdentifiersEntry) predicate.Document

HasIdentifiersWith applies the HasEdge predicate on the "identifiers" edge with a given conditions (other predicates).

func HasMetadata

func HasMetadata() predicate.Document

HasMetadata applies the HasEdge predicate on the "metadata" edge.

func HasMetadataWith

func HasMetadataWith(preds ...predicate.Metadata) predicate.Document

HasMetadataWith applies the HasEdge predicate on the "metadata" edge with a given conditions (other predicates).

func HasNodeList

func HasNodeList() predicate.Document

HasNodeList applies the HasEdge predicate on the "node_list" edge.

func HasNodeListWith

func HasNodeListWith(preds ...predicate.NodeList) predicate.Document

HasNodeListWith applies the HasEdge predicate on the "node_list" edge with a given conditions (other predicates).

func HasNodes added in v0.2.0

func HasNodes() predicate.Document

HasNodes applies the HasEdge predicate on the "nodes" edge.

func HasNodesWith added in v0.2.0

func HasNodesWith(preds ...predicate.Node) predicate.Document

HasNodesWith applies the HasEdge predicate on the "nodes" edge with a given conditions (other predicates).

func HasPersons added in v0.2.0

func HasPersons() predicate.Document

HasPersons applies the HasEdge predicate on the "persons" edge.

func HasPersonsWith added in v0.2.0

func HasPersonsWith(preds ...predicate.Person) predicate.Document

HasPersonsWith applies the HasEdge predicate on the "persons" edge with a given conditions (other predicates).

func HasProperties added in v0.2.0

func HasProperties() predicate.Document

HasProperties applies the HasEdge predicate on the "properties" edge.

func HasPropertiesWith added in v0.2.0

func HasPropertiesWith(preds ...predicate.Property) predicate.Document

HasPropertiesWith applies the HasEdge predicate on the "properties" edge with a given conditions (other predicates).

func HasPurposes added in v0.2.0

func HasPurposes() predicate.Document

HasPurposes applies the HasEdge predicate on the "purposes" edge.

func HasPurposesWith added in v0.2.0

func HasPurposesWith(preds ...predicate.Purpose) predicate.Document

HasPurposesWith applies the HasEdge predicate on the "purposes" edge with a given conditions (other predicates).

func HasSourceData added in v0.2.0

func HasSourceData() predicate.Document

HasSourceData applies the HasEdge predicate on the "source_data" edge.

func HasSourceDataWith added in v0.2.0

func HasSourceDataWith(preds ...predicate.SourceData) predicate.Document

HasSourceDataWith applies the HasEdge predicate on the "source_data" edge with a given conditions (other predicates).

func HasTools added in v0.2.0

func HasTools() predicate.Document

HasTools applies the HasEdge predicate on the "tools" edge.

func HasToolsWith added in v0.2.0

func HasToolsWith(preds ...predicate.Tool) predicate.Document

HasToolsWith applies the HasEdge predicate on the "tools" edge with a given conditions (other predicates).

func ID

func ID(id uuid.UUID) predicate.Document

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Document

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Document

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Document

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...uuid.UUID) predicate.Document

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Document

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Document

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Document

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...uuid.UUID) predicate.Document

IDNotIn applies the NotIn predicate on the ID field.

func MetadataID added in v0.2.0

func MetadataID(v uuid.UUID) predicate.Document

MetadataID applies equality check predicate on the "metadata_id" field. It's identical to MetadataIDEQ.

func MetadataIDEQ added in v0.2.0

func MetadataIDEQ(v uuid.UUID) predicate.Document

MetadataIDEQ applies the EQ predicate on the "metadata_id" field.

func MetadataIDIn added in v0.2.0

func MetadataIDIn(vs ...uuid.UUID) predicate.Document

MetadataIDIn applies the In predicate on the "metadata_id" field.

func MetadataIDIsNil added in v0.2.0

func MetadataIDIsNil() predicate.Document

MetadataIDIsNil applies the IsNil predicate on the "metadata_id" field.

func MetadataIDNEQ added in v0.2.0

func MetadataIDNEQ(v uuid.UUID) predicate.Document

MetadataIDNEQ applies the NEQ predicate on the "metadata_id" field.

func MetadataIDNotIn added in v0.2.0

func MetadataIDNotIn(vs ...uuid.UUID) predicate.Document

MetadataIDNotIn applies the NotIn predicate on the "metadata_id" field.

func MetadataIDNotNil added in v0.2.0

func MetadataIDNotNil() predicate.Document

MetadataIDNotNil applies the NotNil predicate on the "metadata_id" field.

func NodeListID added in v0.2.0

func NodeListID(v uuid.UUID) predicate.Document

NodeListID applies equality check predicate on the "node_list_id" field. It's identical to NodeListIDEQ.

func NodeListIDEQ added in v0.2.0

func NodeListIDEQ(v uuid.UUID) predicate.Document

NodeListIDEQ applies the EQ predicate on the "node_list_id" field.

func NodeListIDIn added in v0.2.0

func NodeListIDIn(vs ...uuid.UUID) predicate.Document

NodeListIDIn applies the In predicate on the "node_list_id" field.

func NodeListIDIsNil added in v0.2.0

func NodeListIDIsNil() predicate.Document

NodeListIDIsNil applies the IsNil predicate on the "node_list_id" field.

func NodeListIDNEQ added in v0.2.0

func NodeListIDNEQ(v uuid.UUID) predicate.Document

NodeListIDNEQ applies the NEQ predicate on the "node_list_id" field.

func NodeListIDNotIn added in v0.2.0

func NodeListIDNotIn(vs ...uuid.UUID) predicate.Document

NodeListIDNotIn applies the NotIn predicate on the "node_list_id" field.

func NodeListIDNotNil added in v0.2.0

func NodeListIDNotNil() predicate.Document

NodeListIDNotNil applies the NotNil predicate on the "node_list_id" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Document) predicate.Document

Or groups predicates with the OR operator between them.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Document queries.

func ByAnnotations added in v0.1.4

func ByAnnotations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByAnnotations orders the results by annotations terms.

func ByAnnotationsCount added in v0.1.4

func ByAnnotationsCount(opts ...sql.OrderTermOption) OrderOption

ByAnnotationsCount orders the results by annotations count.

func ByDocumentTypes added in v0.2.0

func ByDocumentTypes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByDocumentTypes orders the results by document_types terms.

func ByDocumentTypesCount added in v0.2.0

func ByDocumentTypesCount(opts ...sql.OrderTermOption) OrderOption

ByDocumentTypesCount orders the results by document_types count.

func ByEdgeTypes added in v0.2.0

func ByEdgeTypes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByEdgeTypes orders the results by edge_types terms.

func ByEdgeTypesCount added in v0.2.0

func ByEdgeTypesCount(opts ...sql.OrderTermOption) OrderOption

ByEdgeTypesCount orders the results by edge_types count.

func ByExternalReferences added in v0.2.0

func ByExternalReferences(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByExternalReferences orders the results by external_references terms.

func ByExternalReferencesCount added in v0.2.0

func ByExternalReferencesCount(opts ...sql.OrderTermOption) OrderOption

ByExternalReferencesCount orders the results by external_references count.

func ByHashes added in v0.2.0

func ByHashes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByHashes orders the results by hashes terms.

func ByHashesCount added in v0.2.0

func ByHashesCount(opts ...sql.OrderTermOption) OrderOption

ByHashesCount orders the results by hashes count.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByIdentifiers added in v0.2.0

func ByIdentifiers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByIdentifiers orders the results by identifiers terms.

func ByIdentifiersCount added in v0.2.0

func ByIdentifiersCount(opts ...sql.OrderTermOption) OrderOption

ByIdentifiersCount orders the results by identifiers count.

func ByMetadataField

func ByMetadataField(field string, opts ...sql.OrderTermOption) OrderOption

ByMetadataField orders the results by metadata field.

func ByMetadataID added in v0.2.0

func ByMetadataID(opts ...sql.OrderTermOption) OrderOption

ByMetadataID orders the results by the metadata_id field.

func ByNodeListField

func ByNodeListField(field string, opts ...sql.OrderTermOption) OrderOption

ByNodeListField orders the results by node_list field.

func ByNodeListID added in v0.2.0

func ByNodeListID(opts ...sql.OrderTermOption) OrderOption

ByNodeListID orders the results by the node_list_id field.

func ByNodes added in v0.2.0

func ByNodes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByNodes orders the results by nodes terms.

func ByNodesCount added in v0.2.0

func ByNodesCount(opts ...sql.OrderTermOption) OrderOption

ByNodesCount orders the results by nodes count.

func ByPersons added in v0.2.0

func ByPersons(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByPersons orders the results by persons terms.

func ByPersonsCount added in v0.2.0

func ByPersonsCount(opts ...sql.OrderTermOption) OrderOption

ByPersonsCount orders the results by persons count.

func ByProperties added in v0.2.0

func ByProperties(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByProperties orders the results by properties terms.

func ByPropertiesCount added in v0.2.0

func ByPropertiesCount(opts ...sql.OrderTermOption) OrderOption

ByPropertiesCount orders the results by properties count.

func ByPurposes added in v0.2.0

func ByPurposes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByPurposes orders the results by purposes terms.

func ByPurposesCount added in v0.2.0

func ByPurposesCount(opts ...sql.OrderTermOption) OrderOption

ByPurposesCount orders the results by purposes count.

func BySourceData added in v0.2.0

func BySourceData(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

BySourceData orders the results by source_data terms.

func BySourceDataCount added in v0.2.0

func BySourceDataCount(opts ...sql.OrderTermOption) OrderOption

BySourceDataCount orders the results by source_data count.

func ByTools added in v0.2.0

func ByTools(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByTools orders the results by tools terms.

func ByToolsCount added in v0.2.0

func ByToolsCount(opts ...sql.OrderTermOption) OrderOption

ByToolsCount orders the results by tools count.

Jump to

Keyboard shortcuts

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