Documentation ¶
Index ¶
- Constants
- Variables
- func CamelCase(text string) string
- func CopyStruct(dest interface{}, src interface{}) error
- func FilterAndGroup(filteredArgs chan<- []UserArgument, userArgs <-chan UserArgument, ...)
- func MustOpenCsv(filename string) *os.File
- func OpenCsv(filename string) (*os.File, error)
- func ParseDigits(s string, precision, scale int) error
- func ReadCsv(userArgs chan<- UserArgument, r io.Reader) error
- func ReplOraPh(s string, params []interface{}) string
- func SaveFunctions(dst io.Writer, functions []Function, pkg, pbImport string, saveStructs bool) error
- func SaveProtobuf(dst io.Writer, functions []Function, pkg string) error
- func UnoCap(text string) string
- type Annotation
- type Argument
- type Function
- func ApplyAnnotations(functions []Function, annotations []Annotation) []Function
- func ParseArguments(userArgs <-chan []UserArgument, filter func(string) bool) (functions []Function, err error)
- func ParseCsv(r io.Reader, filter func(string) bool) (functions []Function, err error)
- func ParseCsvFile(filename string, filter func(string) bool) (functions []Function, err error)
- func (f Function) GenChecks(w io.Writer) (string, error)
- func (f Function) HasCursorOut() bool
- func (f Function) Name() string
- func (fun Function) PlsqlBlock(checkName string) (plsql, callFun string)
- func (f Function) RealName() string
- func (f Function) SaveProtobuf(dst io.Writer, seen map[string]struct{}) error
- func (f Function) SaveStruct(dst io.Writer, out bool) error
- func (f Function) String() string
- type NamedArgument
- type PlsType
- type UserArgument
Constants ¶
View Source
const ( MarkNull = "�" // 0x2400 = nul //MarkValid = "板" // 0x6eff = fill; full, satisfied MarkValid = "Valid" // 0x6eff = fill; full, satisfied //MarkHidden = "�" // 0x533f = hide MarkHidden = "_hidden" DefaultMaxVARCHARLength = 32767 DefaultMaxCHARLength = 10 )
View Source
const ( DIR_IN = direction(1) DIR_OUT = direction(2) DIR_INOUT = direction(3) )
View Source
const ( FLAVOR_SIMPLE = flavor(0) FLAVOR_RECORD = flavor(1) FLAVOR_TABLE = flavor(2) )
View Source
const MaxTableSize = 512
MaxTableSize is the maximum size of the array elements
Variables ¶
View Source
var Buffers = newBufPool(1 << 16)
View Source
var ErrInvalidArgument = errors.New("invalid argument")
View Source
var ErrMissingTableOf = errors.New("missing TableOf info")
View Source
var Gogo bool
View Source
var Log = func(...interface{}) error { return nil }
Log is discarded by default.
View Source
var NumberAsString bool
View Source
var SkipMissingTableOf = true
View Source
var UnknownSimpleType = errors.New("unknown simple type")
Functions ¶
func CopyStruct ¶
func CopyStruct(dest interface{}, src interface{}) error
func FilterAndGroup ¶ added in v0.2.16
func FilterAndGroup(filteredArgs chan<- []UserArgument, userArgs <-chan UserArgument, filter func(string) bool)
func MustOpenCsv ¶
MustOpenCsv opens the file, or panics on error
func ParseDigits ¶
func ReadCsv ¶
func ReadCsv(userArgs chan<- UserArgument, r io.Reader) error
ReadCsv reads the csv from the Reader, and sends the arguments to the given channel.
func SaveFunctions ¶
Types ¶
type Annotation ¶ added in v0.4.0
type Annotation struct {
Package, Type, Name, Other string
}
func (Annotation) FullName ¶ added in v0.4.0
func (a Annotation) FullName() string
func (Annotation) FullOther ¶ added in v0.4.0
func (a Annotation) FullOther() string
func (Annotation) String ¶ added in v0.4.0
func (a Annotation) String() string
type Argument ¶
type Argument struct { RecordOf []NamedArgument //this argument is a record (map) of this type Name string Type, TypeName string AbsType string Charset string Charlength uint TableOf *Argument // this argument is a table (array) of this type PlsType Flavor flavor Direction direction Precision uint8 Scale uint8 // contains filtered or unexported fields }
func NewArgument ¶
type Function ¶
type Function struct { Package string Returns *Argument Args []Argument Documentation string Replacement *Function // contains filtered or unexported fields }
func ApplyAnnotations ¶ added in v0.4.0
func ApplyAnnotations(functions []Function, annotations []Annotation) []Function
func ParseArguments ¶
func ParseArguments(userArgs <-chan []UserArgument, filter func(string) bool) (functions []Function, err error)
func ParseCsvFile ¶
ParseCsv reads the given csv file as user_arguments The csv should be an export of
SELECT object_id, subprogram_id, package_name, sequence, object_name, data_level, argument_name, in_out, data_type, data_precision, data_scale, character_set_name, pls_type, char_length, type_owner, type_name, type_subname, type_link FROM user_arguments ORDER BY object_id, subprogram_id, SEQUENCE;
func (Function) HasCursorOut ¶
func (Function) PlsqlBlock ¶
SavePlsqlBlock saves the plsql block definition into writer
func (Function) SaveProtobuf ¶
type NamedArgument ¶
type PlsType ¶
type PlsType struct {
// contains filtered or unexported fields
}
func NewPlsType ¶
NewArg returns a new argument to ease arument conversions.
type UserArgument ¶
type UserArgument struct { PackageName string `sql:"PACKAGE_NAME"` ObjectName string `sql:"OBJECT_NAME"` ArgumentName string `sql:"ARGUMENT_NAME"` InOut string `sql:"IN_OUT"` DataType string `sql:"DATA_TYPE"` CharacterSetName string `sql:"CHARACTER_SET_NAME"` PlsType string `sql:"PLS_TYPE"` TypeLink string `sql:"TYPE_LINK"` TypeOwner string `sql:"TYPE_OWNER"` TypeName string `sql:"TYPE_NAME"` TypeSubname string `sql:"TYPE_SUBNAME"` ObjectID uint `sql:"OBJECT_ID"` SubprogramID uint `sql:"SUBPROGRAM_ID"` CharLength uint `sql:"CHAR_LENGTH"` Position uint `sql:"POSITION"` DataPrecision uint8 `sql:"DATA_PRECISION"` DataScale uint8 `sql:"DATA_SCALE"` DataLevel uint8 `sql:"DATA_LEVEL"` }
UserArgument represents the required info from the user_arguments view
Source Files ¶
Click to show internal directories.
Click to hide internal directories.