toolkit

package module
v0.0.0-...-d72c6c5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package toolkit contains structures and functions required for interacting with different databases sub packages has the drivers for interacting with different databases

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	//Name of the column
	Name string
	//DataType is the data type of the column
	DataType string
	//DateFormat is the format of the date type if column's data type is date
	DateFormat string
}

Column holds the information about a column and its data type

type Datastore

type Datastore interface {
	//DumpCSV will dump the given csv file to the datastore.
	//Default behaviour of the method will be to replace the existing data in the datastore.
	//But if appendData flag is set, then existing data won't be removed instead new data will be appended to it.
	DumpCSV(filename string, tablename string, columns []interpreter.ColumnNode, appendData bool, createTable bool, doScp bool, logger log.Log) error
	//DeleteTable will delete the given table in the datastore
	DeleteTable(tablename string) error
	//Exec can execute a query and return the response as the array of interfaces
	Exec(query string, args ...interface{}) ([]map[string]interface{}, error)
	//GetColumnTypes returns the list of columns and their data types for a given table
	GetColumnTypes(tableName string) ([]Column, error)
	//ChangeColumnTypeToDate changes the data type of the given column to date with the provided date format
	ChangeColumnTypeToDate(tableName string, colName string, dateFormat string) error
}

Datastore can store data uploaded/imported by the user to cuttle platform

Directories

Path Synopsis
Package dataset has the utilities to make the datasets efficient.
Package dataset has the utilities to make the datasets efficient.
datastores
postgres
Package postgres has the datastore implementation for the postgres database to store data in cuttle platform
Package postgres has the datastore implementation for the postgres database to store data in cuttle platform
services
Package services has the service models for storing the datastore service info
Package services has the service models for storing the datastore service info

Jump to

Keyboard shortcuts

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