csv2postgres

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 13 Imported by: 0

README

csv2postgres

Golang code generator for importing CSV to PostgreSQL with fun features

Features

  • Importing data from CSV to PostgreSQL
  • Create tables based on CSV data
  • Create additional views
  • Export from PostgreSQL to CSV
  • Manage dependencies between tables and views
  • Use dependency graph from database for rolling back migration, and from code for migrate

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DepsGraph added in v0.2.1

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

DepsGraph specifies dependencies graph.

func NewDepsGraph added in v0.2.1

func NewDepsGraph(targets []string) *DepsGraph

NewDepsGraph returns a new DepsGraph.

func (DepsGraph) CreateOrder added in v0.2.1

func (d DepsGraph) CreateOrder(target string) (path []string, err error)

CreateOrder returns list of creation order for target.

func (DepsGraph) CreateOrderAll added in v0.2.1

func (d DepsGraph) CreateOrderAll() (path []string)

CreateOrderAll returns list of creation order.

func (*DepsGraph) DependsOn added in v0.2.1

func (d *DepsGraph) DependsOn(a, b string) error

DependsOn creates new dependency: a depends to b

func (DepsGraph) DropOrder added in v0.2.1

func (d DepsGraph) DropOrder(target string) (path []string, err error)

DropOrder returns list of deletion order for target.

func (DepsGraph) DropOrderAll added in v0.2.1

func (d DepsGraph) DropOrderAll() (path []string)

DropOrderAll returns list of deletion order.

func (*DepsGraph) Finalize added in v0.2.1

func (d *DepsGraph) Finalize() error

Finalize finalizes dependency graph. Querying dependency order can only be calculated if it has been finalizes.

type Generator

type Generator struct {
	BaseImportPath string
	OutDir         string
	Specs          []string
	Views          string
}

Generator specifies the generator configurations.

func (Generator) Generate

func (g Generator) Generate() error

Generate generates source codes based on spec

Directories

Path Synopsis
internal
box

Jump to

Keyboard shortcuts

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