Documentation
¶
Index ¶
- Constants
- func DefaultNeo4jCSVNornicSchemaPath(dir string) string
- func DefaultNeo4jCSVSchemaPath(dir string) string
- func DiscoverNeo4jCSVSources(dir string, opts Options) (nodeSources []string, relSources []string, err error)
- func ExportNeo4jCSV(engine storage.Engine, opts Neo4jCSVExportOptions) error
- func ExportNeo4jCSVWithContext(ctx context.Context, engine storage.Engine, opts Neo4jCSVExportOptions) error
- type Error
- type Neo4jCSVExportOptions
- type Options
- type Report
- func ImportFull(ctx context.Context, engine storage.Engine, opts Options) (Report, error)
- func StageFull(ctx context.Context, root string, opts Options) (id string, report Report, result error)
- func StageFullWithKey(ctx context.Context, root string, opts Options, key []byte) (id string, report Report, result error)
Constants ¶
const ( ExitOK = 0 ExitCSV = 2 ExitBadRelationship = 3 ExitDuplicateID = 4 ExitConstraintViolation = 5 ExitUnsupported = 6 )
const Neo4jCSVNornicSchemaFileName = "schema.nornic.json"
const Neo4jCSVSchemaFileName = "schema.cypher"
Variables ¶
This section is empty.
Functions ¶
func DiscoverNeo4jCSVSources ¶
func ExportNeo4jCSV ¶
func ExportNeo4jCSV(engine storage.Engine, opts Neo4jCSVExportOptions) error
ExportNeo4jCSV writes a Neo4j-compatible node, relationship and schema package. Labels that the configured label field cannot preserve are rejected before any package file is created or truncated. For example, label "Part;Archive" requires an ArrayDelimiter other than ';' for both export and import.
func ExportNeo4jCSVWithContext ¶
func ExportNeo4jCSVWithContext(ctx context.Context, engine storage.Engine, opts Neo4jCSVExportOptions) error
ExportNeo4jCSVWithContext lets callers cancel the graph scan before the CSV package is written. Once output starts, finish writing the package files.
Types ¶
type Error ¶
type Error struct {
ExitCode int
Message string
LocalizedMessage localization.Message
Err error
}
func NewLocalizedError ¶ added in v1.3.1
func NewLocalizedError(exitCode int, message localization.Message, err error) *Error
NewLocalizedError creates an import error with a stable exit code and message descriptor.
type Neo4jCSVExportOptions ¶
type Neo4jCSVExportOptions struct {
OutputDir string
Delimiter rune
ArrayDelimiter rune
VectorDelimiter rune
Quote rune
}
Neo4jCSVExportOptions configures the offline CSV package. ArrayDelimiter defaults to a semicolon. Export rejects labels containing that delimiter, empty labels, and surrounding whitespace because import cannot preserve them.
type Options ¶
type Options struct {
DatabaseName string
NodeSources []string
RelSources []string
DataDir string
Delimiter rune
ArrayDelimiter rune
VectorDelimiter rune
Quote rune
IDType string
NormalizeTypes bool
IgnoreExtraColumns bool
IgnoreEmptyStrings bool
BadTolerance int
SkipBadRelationships bool
SkipDuplicateNodes bool
ReportFile string
SchemaFile string
BuildIndexes bool
ChunkSize int
Now time.Time
Verbose bool
}
type Report ¶
type Report struct {
DatabaseName string `json:"databaseName"`
NodesImported int64 `json:"nodesImported"`
RelationshipsImported int64 `json:"relationshipsImported"`
BadRelationships int64 `json:"badRelationships"`
DuplicateNodesSkipped int64 `json:"duplicateNodesSkipped"`
IndexesBuilt bool `json:"indexesBuilt"`
StartedAt time.Time `json:"startedAt"`
CompletedAt time.Time `json:"completedAt"`
Duration time.Duration `json:"durationNanos"`
Status string `json:"status"`
Errors []string `json:"errors,omitempty"`
}
func ImportFull ¶
func StageFull ¶
func StageFull(ctx context.Context, root string, opts Options) (id string, report Report, result error)
StageFull builds a private store under the server data directory and returns its ID only once the graph is durable and the store is closed. Catalog publication is a separate server operation.