sync

package
v0.0.0-...-49d60cc Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase make camelCase into camel_case or nameWithSnakeCase into name_with_snake_case

Types

type DbColumnGetter

type DbColumnGetter struct {
	Db *sql.DB
}

func (DbColumnGetter) GetColumns

func (d DbColumnGetter) GetColumns(tableName string) ([]*sql.ColumnType, error)

type ISyncUtils

type ISyncUtils interface {
	InteractiveSync(entity interface{})
	ForceSync(entity interface{})
	CheckTable(entity interface{}) error
	DropTable(entity interface{}) error
	CreateTable(entity interface{}) error
}

type SyncUtilGorm

type SyncUtilGorm struct {
	Db *sql.DB
}

func (SyncUtilGorm) CheckTableGorm

func (s SyncUtilGorm) CheckTableGorm(entity interface{}) error

CheckTable CheckTable is exists and have columns that ready to filled with Field from struct

type SyncUtils

type SyncUtils struct {
	Db *sql.DB
}

func (SyncUtils) CheckTable

func (s SyncUtils) CheckTable(entity interface{}) error

CheckTable CheckTable is exists and have columns that ready to filled with Field from struct

func (SyncUtils) CreateTable

func (s SyncUtils) CreateTable(entity interface{}) error

CreateTable create table with columns as same as field

func (SyncUtils) DropTable

func (s SyncUtils) DropTable(entity interface{}) error

DropTable just drop the table

func (SyncUtils) ForceSync

func (s SyncUtils) ForceSync(entity interface{})

func (SyncUtils) InteractiveSync

func (s SyncUtils) InteractiveSync(entity interface{})

func (SyncUtils) RecreateTable

func (s SyncUtils) RecreateTable(entity interface{})

Jump to

Keyboard shortcuts

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