codium_shared

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: MIT Imports: 10 Imported by: 1

README

codium_shared

This library is shared by the programs of this project.

Documentation

Overview

Package codium_shared is a library shared by the programs of the codium project.

Index

Constants

View Source
const (
	DateFormat             = "2006-01-02 MST"
	DateFormatNoTZ         = "2006-01-02"
	DateTimeFormat         = "2006-01-02T15:04:05 MST"
	DateTimeFormatNoTZAndS = "2006-01-02T15:04"
)

Variables

This section is empty.

Functions

func DoesTableExists added in v1.2.0

func DoesTableExists(projName, tableName string) bool

func GetDataPath

func GetDataPath() (string, error)

func GetSetting added in v1.1.8

func GetSetting(settingName string) (string, error)

func MakeIndex added in v1.2.0

func MakeIndex(projName, tableName, fieldName, newData, rowId string) error

func MakeSafeIndexName added in v1.2.0

func MakeSafeIndexName(v string) string

func UntestedRandomString added in v1.2.0

func UntestedRandomString(length int) string

Types

type FieldDefn

type FieldDefn struct {
	FieldName string
	FieldType string
	Required  bool
	Unique    bool
}

type FkeyDefn

type FkeyDefn struct {
	FieldName        string
	PointingTable    string
	OnDeleteEmpty    bool
	OnDeleteDelete   bool
	OnDeleteRestrict bool
}

type QueryData

type QueryData struct {
	Fields         []string
	TableName      string
	ExpandTable    bool
	Distinct       bool
	Limit          string
	StartIndex     string
	OrderBy        string
	OrderDirection string // one of "asc", "desc"
	WhereOpts      []WhereOptions
}

func ParseSearchStmt

func ParseSearchStmt(stmt string) (QueryData, error)

type TableDefn

type TableDefn struct {
	TableName    string
	Fields       []FieldDefn
	ForeignKeys  []FkeyDefn
	UniqueGroups [][]string
}

func GetVersionedTableDefn added in v1.2.0

func GetVersionedTableDefn(projName, tableName, version string) (TableDefn, error)

func ParseTableDefnStmt

func ParseTableDefnStmt(stmt string) (TableDefn, error)

type WhereOptions

type WhereOptions struct {
	Key           string
	Value         string
	Relation      string   // one of "eq", "neq", "gt", "gteq", "lt", "lteq", in
	Joiner        string   // one of "and", "or"
	InOrNinValues []string // set when the where relation is either in
}

Jump to

Keyboard shortcuts

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