core

package
v0.0.0-...-22ac7ce Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package core encapsulates an implementation for a given schema attached to a generator. This code represents an example implementation for oracle

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Begin

func Begin(name string) string

Begin renders a SQL BEGIN statement for us

func BindingDelete

func BindingDelete(g *sg.SQLGenerator, sch *schema.Schema, queryVals *object.Object) (string, []interface{}, error)

BindingDelete generates the appropriate SQL, binding args, and binding where clause parameters to execute the requested delete operation. 'obj' is not required to be a

func BindingInsert

func BindingInsert(g *sg.SQLGenerator, sch *schema.Schema, table string, data map[string]interface{}) (string, []interface{}, error)

BindingInsert generates the SQL for a given INSERT statement for oracle with binding parameter values

func BindingInsertSQL

func BindingInsertSQL(schTable *schema.Table, tableName string, colNames []string, bindNames []string, identityCol string) string

func BindingRetrieve

func BindingRetrieve(g *sg.SQLGenerator, sch *schema.Schema, obj *object.Object) (string, []string, []interface{}, error)

BindingRetrieve accepts a schema and an object, constructing the appropriate SELECT statement to retrieve the object. It will return sqlStr, the EssentialColumns used, and the binding where clause. DEBUG mode may be turned on by setting an environment parameter, "DEBUG".

func BindingUpdate

func BindingUpdate(g *sg.SQLGenerator, sch *schema.Schema, obj *object.Object) (string, []interface{}, []interface{}, error)

BindingUpdate generates the SQL for a given UPDATE statement for oracle with binding parameter values

func Commit

func Commit() string

Commit returns a SQL Commit statement for us

func CoreBindingInsert

func CoreBindingInsert(g *sg.SQLGenerator, schTable *schema.Table, data map[string]interface{}, identityCol string, fieldsMap map[string]*schema.Column) ([]string, []string, []interface{})

func CreateTable

func CreateTable(g *sg.SQLGenerator, s *schema.Schema, table string) (string, error)

CreateTable determines the SQL to create a given table within a schema

func DropTable

func DropTable(name string) string

DropTable renders a SQL drop table statement for us

func DynamicObjectSetter

func DynamicObjectSetter(s *sg.SQLGenerator, schTable *schema.Table, columnNames []string, columnPointers []interface{}, columnTypes []*sql.ColumnType, obj *object.Object) error

DynamicObjectSetter is used to dynamically set the values of an object by checking the necessary types (via sql.ColumnType, and what the driver tells us we have for column types)

func GetLock

func GetLock(g *sg.SQLGenerator, sch *schema.Schema, lockStr string) (string, []interface{}, error)

func MakeColumnPointers

func MakeColumnPointers(s *sg.SQLGenerator, schTable *schema.Table, columnNames []string, columnTypes []*sql.ColumnType) ([]interface{}, error)

func New

func New() *sg.SQLGenerator

func ReleaseLock

func ReleaseLock(g *sg.SQLGenerator, sch *schema.Schema, lockStr string) (string, []interface{}, error)

func RenderBindingValueWithInt

func RenderBindingValueWithInt(f *schema.Column, i int) string

func RenderInsertValue

func RenderInsertValue(bindI *int, f *schema.Column, value interface{}) (interface{}, error)

func RenderUpdateWhereClause

func RenderUpdateWhereClause(g *sg.SQLGenerator, schTable *schema.Table, fieldsMap map[string]*schema.Column, obj *object.Object) (string, []interface{}, *int, error)

func RenderWhereClause

func RenderWhereClause(g *sg.SQLGenerator, schTable *schema.Table, obj *object.Object) (string, []interface{}, error)

Types

type NullTime

type NullTime time.Time

func (*NullTime) Scan

func (n *NullTime) Scan(src interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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