tools

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInsertValuePlaceHolder

func BuildInsertValuePlaceHolder(itemLength, valueLength int) string

BuildInsertValuePlaceHolder 生成批量写入 Mysql 时的占位符 INSERT INTO `table`(col1, col2) values < 占位符... > 如果需要批量插入时 values 后面的占位符处理起来会很痛苦,这个方法可以根据字段 的数量和插入的数据的数量生成相应的占位符,业务层只需要 Fprintf 插入到自己的 sql 中即可 colCount 指的是字段的数量,控制每个括号里有几个占位符 valCount 指的是需要插入的数据的数量,控制需要生成多少个占位符

str := BuildInsertValuePlaceHolder(2, 3)
str == "(?, ?), (?, ?), (?, ?)"

Types

type LRUCache

type LRUCache struct {
	// contains filtered or unexported fields
}

LRUCache not implemented

Jump to

Keyboard shortcuts

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