jgpg

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 4 Imported by: 0

README

postgresql

操作postgresql的脚手架函数 基于gorm.io/gorm

Documentation

Index

Constants

View Source
const (
	// 字段类型
	CT_SMALLINT    = "SMALLINT"
	CT_INT         = "INT"
	CT_BIGINT      = "BIGINT"
	CT_DECIMAL     = "DECIMAL"
	CT_FLOAT       = "FLOAT"
	CT_DOUBLE      = "DOUBLE"
	CT_TEXT        = "TEXT"
	CT_CHAR        = "CHAR"
	CT_VARCHAR     = "VARCHAR"
	CT_JSON        = "JSON"
	CT_JSONB       = "JSONB"
	CT_DATE        = "DATE"
	CT_TIME        = "TIME"
	CT_TIMESTAMP   = "TIMESTAMP"
	CT_BOOL        = "BOOL"
	CT_TIMETZ      = "TIMETZ"
	CT_TIMESTAMPTZ = "TIMESTAMPTZ"
	CT_BYTEA       = "BYTEA"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

type Helper struct {
	DB *gorm.DB
}

func NewHelper

func NewHelper(db *gorm.DB) *Helper

func (*Helper) QueryAllTables

func (h *Helper) QueryAllTables() ([]string, error)

query all tables of database

func (*Helper) QueryCreateTableSql

func (h *Helper) QueryCreateTableSql(tableName string) (string, error)

query create table sql

func (*Helper) QueryDBCharset

func (h *Helper) QueryDBCharset() (string, error)

query charset of database

func (*Helper) QueryDBCollate

func (h *Helper) QueryDBCollate() (string, error)

query collate of database

func (*Helper) QueryDBVersion

func (h *Helper) QueryDBVersion() (string, error)

query version of database

Jump to

Keyboard shortcuts

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