kotlin

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceKtImports

func InterfaceKtImports(r KtGenerateable, settings config.CombinedSettings) [][]string

func KtDataClassName

func KtDataClassName(name string, settings config.CombinedSettings) string

func KtGenerate

func KtGenerate(r KtGenerateable, settings config.CombinedSettings) (map[string]string, error)

func KtImports

func KtImports(r KtGenerateable, settings config.CombinedSettings) func(string) [][]string

func KtMemberName

func KtMemberName(name string, settings config.CombinedSettings) string

func KtUsesType

func KtUsesType(r KtGenerateable, typ string, settings config.CombinedSettings) bool

func ModelKtImports

func ModelKtImports(r KtGenerateable, settings config.CombinedSettings) [][]string

func Offset

func Offset(v int) int

func QueryKtImports

func QueryKtImports(r KtGenerateable, settings config.CombinedSettings, filename string) [][]string

Types

type KtConstant

type KtConstant struct {
	Name  string
	Type  string
	Value string
}

type KtEnum

type KtEnum struct {
	Name      string
	Comment   string
	Constants []KtConstant
}

type KtField

type KtField struct {
	Name    string
	Type    ktType
	Comment string
}

type KtGenerateable

type KtGenerateable interface {
	KtDataClasses(settings config.CombinedSettings) []KtStruct
	KtQueries(settings config.CombinedSettings) []KtQuery
	KtEnums(settings config.CombinedSettings) []KtEnum
}

type KtParams

type KtParams struct {
	Struct *KtStruct
}

func (KtParams) Args

func (v KtParams) Args() string

func (KtParams) Bindings

func (v KtParams) Bindings() string

type KtQuery

type KtQuery struct {
	ClassName    string
	Cmd          string
	Comments     []string
	MethodName   string
	FieldName    string
	ConstantName string
	SQL          string
	SourceName   string
	Ret          KtQueryValue
	Arg          KtParams
}

A struct used to generate methods and fields on the Queries struct

type KtQueryValue

type KtQueryValue struct {
	Emit               bool
	Name               string
	Struct             *KtStruct
	Typ                ktType
	JDBCParamBindCount int
}

func (KtQueryValue) EmitStruct

func (v KtQueryValue) EmitStruct() bool

func (KtQueryValue) IsStruct

func (v KtQueryValue) IsStruct() bool

func (KtQueryValue) ResultSet

func (v KtQueryValue) ResultSet() string

func (KtQueryValue) Type

func (v KtQueryValue) Type() string

type KtStruct

type KtStruct struct {
	Table             core.FQN
	Name              string
	Fields            []KtField
	JDBCParamBindings []KtField
	Comment           string
}

type Result

type Result struct {
	*dinosql.Result
}

Result is a wrapper around *dinosql.Result that extends it with Kotlin support. It can be used to generate both Go and Kotlin code. TODO: This is a temporary hack to ensure minimal chance of merge conflicts while Kotlin support is forked. Once it is merged upstream, we can factor split out Go support from the core dinosql.Result.

func (Result) KtDataClasses

func (r Result) KtDataClasses(settings config.CombinedSettings) []KtStruct

func (Result) KtEnums

func (r Result) KtEnums(settings config.CombinedSettings) []KtEnum

func (Result) KtQueries

func (r Result) KtQueries(settings config.CombinedSettings) []KtQuery

Jump to

Keyboard shortcuts

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