adapter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

This package has database adapter layer. Never deal with DDL construction.

Index

Constants

View Source
const (
	DatabaseTypeMysql = DatabaseType(iota)
	DatabaseTypePostgres
)

Variables

This section is empty.

Functions

func DumpDDLs

func DumpDDLs(d Database) (string, error)

func RunDDLs

func RunDDLs(d Database, ddls []string) error

Types

type Config

type Config struct {
	DbType   DatabaseType
	DbName   string
	User     string
	Password string
	Host     string
	Port     int
}

type Database

type Database interface {
	TableNames() ([]string, error)
	DumpTableDDL(table string) (string, error)
	DB() *sql.DB
	Close() error
}

Abstraction layer for multiple kinds of databases

type DatabaseType

type DatabaseType int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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