Documentation ¶
Overview ¶
Package postgres has the datastore implementation for the postgres database to store data in cuttle platform
Index ¶
- type Postgres
- func (p Postgres) ChangeColumnTypeToDate(tableName string, colName string, dateFormat string) error
- func (p Postgres) DeleteTable(tablename string) error
- func (p Postgres) DumpCSV(filename string, tablename string, columns []interpreter.ColumnNode, ...) error
- func (p Postgres) Exec(query string, args ...interface{}) ([]map[string]interface{}, error)
- func (p Postgres) GetColumnTypes(tableName string) ([]toolkit.Column, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
type Postgres struct { //DB connection instance DB *sql.DB //DataDumpDirectory will be the name of the directory with the user name attached to it //Eg. user@myserver.com:/home/user/data-directory DataDumpDirectory string }
Postgres is the postgre datastore
func NewPostgres ¶
func NewPostgres(host, port, dbName, username, password, dataDumpDirectory string) (*Postgres, error)
NewPostgres returns the postgres with active connection
func (Postgres) ChangeColumnTypeToDate ¶
ChangeColumnTypeToDate changes a given column's data type to date with the date format as provided
func (Postgres) DeleteTable ¶
DeleteTable deletes the table from the datastore
func (Postgres) DumpCSV ¶
func (p Postgres) DumpCSV(filename string, tablename string, columns []interpreter.ColumnNode, appendData bool, createTable bool, doScp bool, logger log.Log) error
DumpCSV will dump the given csv file to post instance
Click to show internal directories.
Click to hide internal directories.