SqlEr

package module
v0.0.0-...-1f74595 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: MIT Imports: 5 Imported by: 1

README

SqlEr

Postgres checks for tables existing

Documentation

Index

Constants

View Source
const ValidateData = false

Variables

This section is empty.

Functions

func AlterTable

func AlterTable(tab *TableType) bool

func CreateTable

func CreateTable(tab *TableType) bool

func IfTableColumnsExists

func IfTableColumnsExists(tab *TableType) bool

func IfTableExists

func IfTableExists(tn string) bool

Types

type SqlErType

type SqlErType struct {
	FileName string
	Sql      SqlType
}

func ValidateInstallModel

func ValidateInstallModel(fn string) (rv *SqlErType)

func (*SqlErType) CheckTables

func (se *SqlErType) CheckTables()

func (*SqlErType) RunASQLCommand

func (se *SqlErType) RunASQLCommand(conn *sizlib.MyDb, cmd string, cmdNo int) (err error)

func (*SqlErType) RunSliceOfSQLCommands

func (se *SqlErType) RunSliceOfSQLCommands(conn *sizlib.MyDb, cmd []string) (err error)

type SqlType

type SqlType struct {
	Tables []TableType
}

type TableColumnsType

type TableColumnsType struct {
	ColumnName      string
	ColumnType      string
	ColumnLen       int
	ColumnPrecision int
	ColumnDefault   string
	ColumnOpts      string // not null, pimary key etc.
}

type TableType

type TableType struct {
	TableName        string
	TableColumnsName []TableColumnsType
	DDL              []string
	AlterDDL         []string
	Data             []string
}

Jump to

Keyboard shortcuts

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