orm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(table *table.Table, undoList *[]string, dbx *db.Dbx) error

func DbString

func DbString(cfg db.DbConfig) string

func DeleteTable

func DeleteTable(table *table.Table, undoList *[]string, dbx *db.Dbx) error

func IsEntityExists

func IsEntityExists(name string, dbConfig db.DbConfig) bool

func Migrage

func Migrage(d *model.Diff, dbConfig db.DbConfig)

func ModifyTable

func ModifyTable(tableDiff *model.TableDiff, undoList *[]string, dbx *db.Dbx) error

Types

type InsanceData

type InsanceData = map[string]interface{}

type QueryResponse

type QueryResponse struct {
	Nodes []map[string]interface{} `json:"nodes"`
	Total int                      `json:"total"`
}

type Session

type Session struct {
	Dbx *db.Dbx
	// contains filtered or unexported fields
}

func Open

func Open(dbConfig db.DbConfig, m *model.Model) (*Session, error)

func OpenWithoutRepository

func OpenWithoutRepository(dbConfig db.DbConfig) (*Session, error)

func (*Session) BatchRealAssociations

func (s *Session) BatchRealAssociations(
	association *graph.Association,
	ids []uint64,
	args graph.QueryArg,
) []InsanceData

func (*Session) BeginTx

func (s *Session) BeginTx() error

func (*Session) ClearTx

func (s *Session) ClearTx()

func (*Session) Commit

func (s *Session) Commit() error

func (*Session) CreateId

func (s *Session) CreateId() int

use for sql join table

func (*Session) DeleteAssociationPovit

func (s *Session) DeleteAssociationPovit(povit *data.AssociationPovit)

func (*Session) DeleteInstance

func (s *Session) DeleteInstance(entityName string, id shared.ID)

func (*Session) Query

func (s *Session) Query(entityName string, args map[string]interface{}, fieldNames []string) QueryResponse

func (*Session) QueryAssociatedInstances

func (s *Session) QueryAssociatedInstances(a *graph.Association, ownerId uint64) []InsanceData

func (*Session) QueryByIds

func (s *Session) QueryByIds(entityName string, ids []interface{}) []InsanceData

func (*Session) QueryOne

func (s *Session) QueryOne(entityName string, args map[string]interface{}) interface{}

func (*Session) QueryOneById

func (s *Session) QueryOneById(entityName string, id interface{}) interface{}

func (*Session) SaveAssociation

func (s *Session) SaveAssociation(r *data.AssociationRef, ownerId uint64) error

func (*Session) SaveAssociationPovit

func (s *Session) SaveAssociationPovit(povit *data.AssociationPovit)

func (*Session) SaveOne

func (s *Session) SaveOne(entityName string, object map[string]interface{}) (uint64, error)

Jump to

Keyboard shortcuts

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