x

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0, UPL-1.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirIn    = direction(1)
	DirOut   = direction(2)
	DirInOut = direction(3)
)
View Source
const (
	MarkNull = "\u2400" // 0x2400 = nul
	//MarkValid  = "\u6eff" // 0x6eff = fill; full, satisfied
	MarkValid = "Valid" // 0x6eff = fill; full, satisfied
	//MarkHidden = "\u533f"     // 0x533f = hide
	MarkHidden = "_hidden"

	DefaultMaxVARCHARLength = 32767
	DefaultMaxCHARLength    = 10
)

Variables

View Source
var Buffers = newBufPool(1 << 16)
View Source
var ErrUnknownScalarType = errors.New("unknown scalar type")
View Source
var MaxTableSize = 128

MaxTableSize is the maximum size of the array elements

View Source
var SBuffers = newSBufPool()

Functions

func CamelCase

func CamelCase(text string) string

func SaveProtobuf

func SaveProtobuf(dst io.Writer, functions []Function, pkg string) error

func UnoCap

func UnoCap(text string) string

Types

type Argument

type Argument struct {
	Attribute
	Direction direction
}

func (Argument) IsInput

func (a Argument) IsInput() bool

func (Argument) IsOutput

func (a Argument) IsOutput() bool

func (Argument) String

func (a Argument) String() string

type Attribute

type Attribute struct {
	Name    string
	AbsType string `json:",omitempty"`

	Type ObjectOrScalar
	// contains filtered or unexported fields
}

func (Attribute) FromOra

func (arg Attribute) FromOra(dst, src, varName string) string

FromOra retrieves the value of the argument with arg type, from src variable to dst variable.

func (Attribute) IsScalar

func (a Attribute) IsScalar() bool

func (Attribute) ToOra

func (arg Attribute) ToOra(dst, src string, dir direction) (expr string, variable string)

ToOra adds the value of the argument with arg type, from src variable to dst variable.

type DB

type DB struct {
	DB querier
	// contains filtered or unexported fields
}

func (*DB) ReadObject

func (db *DB) ReadObject(ctx context.Context, name Triplet) (*Object, error)

func (*DB) ReadPackage

func (db *DB) ReadPackage(ctx context.Context, pkg string) ([]Function, error)

type Function

type Function struct {
	Triplet
	Alias             string     `json:",omitempty"`
	Args              []Argument `json:",omitempty"`
	Returns           *Attribute `json:",omitempty"`
	Replacement       *Function  `json:",omitempty"`
	ReplacementIsJSON bool       `json:",omitempty"`
	LastDDL           time.Time  `json:",omitempty"`

	Documentation string `json:",omitempty"`
	// contains filtered or unexported fields
}

func (Function) AliasedName

func (f Function) AliasedName() string

func (Function) FullName

func (f Function) FullName() string

func (Function) HasCursorOut

func (f Function) HasCursorOut() bool

func (Function) PlsqlBlock

func (fun Function) PlsqlBlock(checkName string) (plsql, callFun string)

SavePlsqlBlock saves the plsql block definition into writer

func (Function) RealName

func (f Function) RealName() string

func (Function) SaveProtobuf

func (f Function) SaveProtobuf(dst io.Writer, seen map[string]struct{}) error

func (Function) String

func (f Function) String() string

type Object

type Object struct {
	CollectionOf *ObjectOrScalar
	Triplet
	TypeLink                string
	TypeObjectType, PlsType string
	IndexBy                 string
	Attributes              []Attribute
	IsCollection            bool
}

type ObjectOrScalar

type ObjectOrScalar struct {
	Object
	Scalar
	IsObject bool
}

func (ObjectOrScalar) IsScalar

func (a ObjectOrScalar) IsScalar() bool

type Scalar

type Scalar struct {
	DataType                 string
	Length, Precision, Scale sql.NullInt32
}

func (Scalar) MarshalJSON

func (s Scalar) MarshalJSON() ([]byte, error)

type SqlDB

type SqlDB struct {
	*sql.DB
	LogQry func(qry string, args ...any) (next func(...any), close func())
}

func (SqlDB) QueryContext

func (db SqlDB) QueryContext(ctx context.Context, qry string, args ...any) (rowser, error)

func (SqlDB) QueryRowContext

func (db SqlDB) QueryRowContext(ctx context.Context, qry string, args ...any) rower

type Triplet

type Triplet struct {
	Owner, Package, Name string
}

func (Triplet) ProtoName

func (t Triplet) ProtoName(dirname string) string

Jump to

Keyboard shortcuts

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