database

package
v0.0.0-...-4185faa Latest Latest
Warning

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

Go to latest
Published: Feb 15, 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(id int)

削除

func Init

func Init()

DB初期化

func Insert

func Insert(itemCode string, text string) uint

登録

func Update

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

更新

Types

type Item

type Item struct {
	gorm.Model
	ItemCode string
	Text     string
}

func SelectAll

func SelectAll() []Item

全取得

func SelectRow

func SelectRow(id int) Item

1行取得

Jump to

Keyboard shortcuts

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