driver

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Create stores data and returns results that are containing ReturnFields only
	// if something goes wrong it should return meaningful error.
	Create(Payload) (results []map[string]interface{}, err error)
}

Driver holds implementation of particular storage behind

type Payload

type Payload struct {
	// Entity is a name of database schema/table, index, etc.
	// It may not be required, depends on backend / driver implementation.
	Entity string
	// PrimaryKey is optional, depends on backend / driver implementation.
	PrimaryKey string
	// InsertFields is a list of fields that must be stored
	// (e.g. in SQL database, it could be all field except `id`, which is assigned automatically)
	InsertFields []string
	// ReturnFields is a list of fields that will be returned by Create
	// (e.g. in SQL database, it would probably be all fields, including `id` that was autogenerated)
	ReturnFields []string
	// Data is a list of objects to be created
	Data []map[string]interface{}
}

Payload for Driver.MustCreate

Directories

Path Synopsis
sql
mysql
Package mysql is a MySQL driver for Seedr.
Package mysql is a MySQL driver for Seedr.
mysql/internal/tests/models
Package test_models is an example of basic models setup.
Package test_models is an example of basic models setup.

Jump to

Keyboard shortcuts

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