usecase

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

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) 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 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 SQLite3Interactor

type SQLite3Interactor struct {
	Repository repository.SQLite3Repository
}

SQLite3Interactor implementation of use cases related to SQLite3 handler.

func NewSQLite3Interactor

func NewSQLite3Interactor(r repository.SQLite3Repository) *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, query string) (*model.Table, error)

Exec execute query

func (*SQLite3Interactor) Insert

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

Insert set records in DB

func (*SQLite3Interactor) TablesName added in v0.0.5

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

TablesName return all table name.

Jump to

Keyboard shortcuts

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