usecase

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package usecase provides use cases related to Multiple File Format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVInteractor

type CSVInteractor struct {
	Repository repository.CSVRepository
}

CSVInteractor implementation of use cases related to CSV handler.

func NewCSVInteractor

func NewCSVInteractor(r repository.CSVRepository) *CSVInteractor

NewCSVInteractor return CSVInteractor

func (*CSVInteractor) Dump added in v0.0.7

func (ci *CSVInteractor) Dump(csvFilePath string, table *model.Table) error

Dump write contents of DB table to CSV file

func (*CSVInteractor) List

func (ci *CSVInteractor) List(csvFilePath string) (*model.CSV, error)

List get CSV data. The sqly command does not open many CSV files. Therefore, the file is opened and closed in the usecase layer without worrying about processing speed.

type ExcelInteractor added in v0.7.0

type ExcelInteractor struct {
	repository.ExcelRepository
}

ExcelInteractor implementation of use cases related to Excel handler.

func NewExcelInteractor added in v0.7.0

func NewExcelInteractor(r repository.ExcelRepository) *ExcelInteractor

NewExcelInteractor return ExcelInteractor

func (*ExcelInteractor) Dump added in v0.7.0

func (e *ExcelInteractor) Dump(excelFilePath string, table *model.Table) error

Dump write contents of DB table to JSON file

func (*ExcelInteractor) List added in v0.7.0

func (e *ExcelInteractor) List(excelFilePath, sheetName string) (*model.Excel, error)

List get Excel data.

type HistoryInteractor added in v0.0.5

type HistoryInteractor struct {
	Repository repository.HistoryRepository
}

HistoryInteractor implementation of use cases related to sqly history

func NewHistoryInteractor added in v0.0.5

func NewHistoryInteractor(r repository.HistoryRepository) *HistoryInteractor

NewHistoryInteractor return CSVInteractor

func (*HistoryInteractor) Create added in v0.0.5

func (hi *HistoryInteractor) Create(ctx context.Context, history model.History) error

Create create history record.

func (*HistoryInteractor) CreateTable added in v0.0.5

func (hi *HistoryInteractor) CreateTable(ctx context.Context) error

CreateTable create table for sqly history.

func (*HistoryInteractor) List added in v0.0.5

List get all sqly history.

type JSONInteractor added in v0.3.0

type JSONInteractor struct {
	Repository repository.JSONRepository
}

JSONInteractor implementation of use cases related to JSON handler.

func NewJSONInteractor added in v0.3.0

func NewJSONInteractor(r repository.JSONRepository) *JSONInteractor

NewJSONInteractor return JSONInteractor

func (*JSONInteractor) Dump added in v0.5.0

func (i *JSONInteractor) Dump(jsonFilePath string, table *model.Table) error

Dump write contents of DB table to JSON file

func (*JSONInteractor) List added in v0.3.0

func (i *JSONInteractor) List(jsonFilePath string) (*model.JSON, error)

List get JSON data.

type LTSVInteractor added in v0.5.0

type LTSVInteractor struct {
	Repository repository.LTSVRepository
}

LTSVInteractor implementation of use cases related to LTSV handler.

func NewLTSVInteractor added in v0.5.0

func NewLTSVInteractor(r repository.LTSVRepository) *LTSVInteractor

NewLTSVInteractor return LTSVInteractor

func (*LTSVInteractor) Dump added in v0.5.0

func (li *LTSVInteractor) Dump(ltsvFilePath string, table *model.Table) error

Dump write contents of DB table to LTSV file

func (*LTSVInteractor) List added in v0.5.0

func (li *LTSVInteractor) List(ltsvFilePath string) (*model.LTSV, error)

List get LTSV data.

type SQL added in v0.0.7

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

SQL is sql information

func NewSQL added in v0.0.7

func NewSQL() *SQL

NewSQL return *SQL

type SQLite3Interactor

type SQLite3Interactor struct {
	Repository repository.SQLite3Repository
	// contains filtered or unexported fields
}

SQLite3Interactor implementation of use cases related to SQLite3 handler.

func NewSQLite3Interactor

func NewSQLite3Interactor(r repository.SQLite3Repository, sql *SQL) *SQLite3Interactor

NewSQLite3Interactor return CSVInteractor

func (*SQLite3Interactor) CreateTable

func (si *SQLite3Interactor) CreateTable(ctx context.Context, t *model.Table) error

CreateTable create a DB table with columns given as model.Table

func (*SQLite3Interactor) Exec

func (si *SQLite3Interactor) Exec(ctx context.Context, statement string) (int64, error)

Exec execute "INSERT" or "UPDATE" or "DELETE" statement

func (*SQLite3Interactor) ExecSQL added in v0.0.7

func (si *SQLite3Interactor) ExecSQL(ctx context.Context, statement string) (*model.Table, int64, error)

ExecSQL executes "SELECT/EXPLAIN" query or "INSERT/UPDATE/DELETE" statement

func (*SQLite3Interactor) Header added in v0.3.0

func (si *SQLite3Interactor) Header(ctx context.Context, tableName string) (*model.Table, error)

Header get table header name.

func (*SQLite3Interactor) Insert

func (si *SQLite3Interactor) Insert(ctx context.Context, t *model.Table) error

Insert set records in DB

func (*SQLite3Interactor) List added in v0.0.7

func (si *SQLite3Interactor) List(ctx context.Context, tableName string) (*model.Table, error)

List get records in the specified table

func (*SQLite3Interactor) Query added in v0.0.7

func (si *SQLite3Interactor) Query(ctx context.Context, query string) (*model.Table, error)

Query execute "SELECT" or "EXPLAIN" query

func (*SQLite3Interactor) TablesName added in v0.0.5

func (si *SQLite3Interactor) TablesName(ctx context.Context) ([]*model.Table, error)

TablesName return all table name.

type TSVInteractor added in v0.4.0

type TSVInteractor struct {
	Repository repository.TSVRepository
}

TSVInteractor implementation of use cases related to TSV handler.

func NewTSVInteractor added in v0.4.0

func NewTSVInteractor(r repository.TSVRepository) *TSVInteractor

NewTSVInteractor return TSVInteractor

func (*TSVInteractor) Dump added in v0.5.0

func (ti *TSVInteractor) Dump(tsvFilePath string, table *model.Table) error

Dump write contents of DB table to TSV file

func (*TSVInteractor) List added in v0.4.0

func (ti *TSVInteractor) List(TSVFilePath string) (*model.TSV, error)

List get TSV data. The sqly command does not open many TSV files. Therefore, the file is opened and closed in the usecase layer without worrying about processing speed.

Jump to

Keyboard shortcuts

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