So far so good
This commit is contained in:
36
pkg/writers/dctx/writer.go
Normal file
36
pkg/writers/dctx/writer.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package dctx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/writers"
|
||||
)
|
||||
|
||||
// Writer implements the writers.Writer interface for DCTX format
|
||||
// Note: DCTX is a read-only format used for loading Clarion dictionary files
|
||||
type Writer struct {
|
||||
options *writers.WriterOptions
|
||||
}
|
||||
|
||||
// NewWriter creates a new DCTX writer with the given options
|
||||
func NewWriter(options *writers.WriterOptions) *Writer {
|
||||
return &Writer{
|
||||
options: options,
|
||||
}
|
||||
}
|
||||
|
||||
// WriteDatabase returns an error as DCTX format is read-only
|
||||
func (w *Writer) WriteDatabase(db *models.Database) error {
|
||||
return fmt.Errorf("DCTX format is read-only and does not support writing - it is used for loading Clarion dictionary files only")
|
||||
}
|
||||
|
||||
// WriteSchema returns an error as DCTX format is read-only
|
||||
func (w *Writer) WriteSchema(schema *models.Schema) error {
|
||||
return fmt.Errorf("DCTX format is read-only and does not support writing - it is used for loading Clarion dictionary files only")
|
||||
}
|
||||
|
||||
// WriteTable returns an error as DCTX format is read-only
|
||||
func (w *Writer) WriteTable(table *models.Table) error {
|
||||
return fmt.Errorf("DCTX format is read-only and does not support writing - it is used for loading Clarion dictionary files only")
|
||||
}
|
||||
Reference in New Issue
Block a user