conversion

package
v0.0.0-...-b8497f2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversionResult

type ConversionResult struct {
	Traces    []models.SQLTrace
	Templates []models.SQLTemplate
}

ConversionResult holds the result of a trace conversion.

type ConvertRequest

type ConvertRequest struct {
	SourceSchemaPath string
	TargetDBType     string
	OutputPath       string
	SourceDB         string // Optional, will be auto-detected if empty
}

ConvertRequest represents a request to convert a schema.

type ConvertTraceRequest

type ConvertTraceRequest struct {
	SourcePath   string
	TargetDBType string
}

ConvertTraceRequest represents a request to convert traces.

type DefaultService

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

DefaultService is the default implementation of the conversion service.

func (*DefaultService) ConvertFromFile

func (s *DefaultService) ConvertFromFile(ctx context.Context, req ConvertTraceRequest) (*ConversionResult, error)

ConvertFromFile reads SQL traces from a file, optionally translates them, and converts them to templates.

func (*DefaultService) ConvertSchemaFromFile

func (s *DefaultService) ConvertSchemaFromFile(ctx context.Context, req ConvertRequest) error

ConvertSchemaFromFile reads a SQL schema file, converts it to the target dialect, and writes the result.

func (*DefaultService) ConvertStreamingly

func (s *DefaultService) ConvertStreamingly(ctx context.Context, tracePath string, bufferSize int, callback func(models.SQLTrace) error) error

ConvertStreamingly processes traces line-by-line using the provided callback.

type Service

type Service interface {
	ConvertFromFile(ctx context.Context, req ConvertTraceRequest) (*ConversionResult, error)
	ConvertSchemaFromFile(ctx context.Context, req ConvertRequest) error
	ConvertStreamingly(ctx context.Context, tracePath string, bufferSize int, callback func(models.SQLTrace) error) error
}

Service is the interface for the conversion service.

func NewService

func NewService(parser services.Parser, registry *plugin_registry.Registry) Service

NewService creates a new DefaultService.

Jump to

Keyboard shortcuts

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