engine

package
v0.0.0-...-9ed695e Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package engine defines the core structure that drives the ngorm API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTabler

type DBTabler interface {
	TableName(*Engine) string
}

DBTabler is an interface for getting database table name from the *Engine

type Engine

type Engine struct {
	RowsAffected int64

	//When this field is set to true. The table names will not be pluarized.
	//The default behaviour is to plurarize table names e.g Order struct will
	//give orders table name.
	SingularTable bool
	Ctx           context.Context
	Dialect       dialects.Dialect

	Search    *model.Search
	Scope     *model.Scope
	StructMap *model.SafeStructsMap
	SQLDB     model.SQLCommon
	Log       *logger.Zapper

	Now func() time.Time
}

Engine is the driving force for ngorm. It contains, Scope, Search and other utility properties for easily building complex SQL queries.

func (*Engine) AddError

func (e *Engine) AddError(err error) error

AddError adds err to Engine.Error.

THis is here until I refactor all the APIs to return errors instead of patching the Engine with arbitrary erros

type Tabler

type Tabler interface {
	TableName() string
}

Tabler interface for defining table name

Jump to

Keyboard shortcuts

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