engine

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 4 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

func Put

func Put(e *Engine)

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 pluralized.
	//The default behavior is to pluralize 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

	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.

This acts as context, allowing passing values around. For fuc

func Get

func Get() *Engine

func (*Engine) Clone

func (e *Engine) Clone() *Engine

Clone returns a new copy of engine

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