tamate

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 3 Imported by: 0

README

tamate

LICENSE GoDoc Go Report Card

CircleCI

A library to handle table-based data generically.



Features

  • Unification of ambiguous names like left/right
  • Goroutine safe
  • GetRows returns iterator
  • Support TSV
  • Support SQLite
  • Support PostgleSQL

Requirements

  • Go 1.12 or higher. We aim to support the 3 latest versions of Go.

Support Drivers


Installation

Simple install the package to your $GOPATH with the go tool from shell:

$ go get -u github.com/Mitu217/tamate

Make sure Git is installed on your machine and in your system's PATH.

Usage

Tamate Driver is an implementation of tamate/driver interface.

Use csv as driverName and a valid DSN as dataSourceName:

import  "github.com/Mitu217/tamate"
import  _ "github.com/Mitu217/tamate-csv"

ds, err := tamate.Open("csv", "./")
DataSource

DataSource represents the connection destination where table-based data supported by Tamate.

Use this to Get, Set, GettingDiff, etc.

DSN (Data Source Name)

DSN is not only common format such as used in database/sql.

Please refer to the usage of the driver to use.

Testing / Development

Please execute the following command at the root of the project

go test ./...

License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register added in v0.2.0

func Register(name string, driver driver.Driver)

Types

type DataSource added in v0.2.0

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

func Open added in v0.2.0

func Open(name string, dsn string) (*DataSource, error)

func OpenDataSource added in v0.2.0

func OpenDataSource(connector driver.Connector) *DataSource

func (*DataSource) Close added in v0.2.0

func (ds *DataSource) Close() error

func (*DataSource) GetRows added in v0.2.0

func (ds *DataSource) GetRows(ctx context.Context, name string) ([]*driver.Row, error)

func (*DataSource) GetSchema added in v0.2.0

func (ds *DataSource) GetSchema(ctx context.Context, name string) (*driver.Schema, error)

func (*DataSource) SetRows added in v0.2.0

func (ds *DataSource) SetRows(ctx context.Context, name string, rows []*driver.Row) error

func (*DataSource) SetSchema added in v0.2.0

func (ds *DataSource) SetSchema(ctx context.Context, name string, schema *driver.Schema) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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