database

package
v0.0.0-...-86514c6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBMS    = "mysql"
	USER    = "test_user" // DBのユーザ名
	PASS    = "test_pass" // DBのパスワード
	HOST    = "localhost" // DBのホスト名もしくはIP
	PORT    = "3306"      // DBのポート
	DBNAME  = "exampledb" // DB名
	CONNECT = USER + ":" + PASS + "@tcp(" + HOST + ":" + PORT + ")/" + DBNAME + "?parseTime=true"
)

Variables

This section is empty.

Functions

func Close

func Close()

DBクローズ

func Delete

func Delete(original_id int)

削除

func Init

func Init()

DB初期化

func Insert

func Insert(originalId int, itemCode string, text string)

登録

func SelectIdByOriginalId

func SelectIdByOriginalId(original_id int) uint

コピー元のIDを元にレプリカのidを検索する

func Update

func Update(original_id int, itemCode string, text string)

更新

Types

type Replica

type Replica struct {
	gorm.Model
	OriginalId int
	ItemCode   string
	Text       string
}

func SelectAll

func SelectAll() []Replica

全取得

func SelectRow

func SelectRow(id int) Replica

1行取得

Jump to

Keyboard shortcuts

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