relationone2many

package
v0.0.0-...-7203340 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type One

type One struct {
	ID   int64 `sql:"primary key;auto increment"`
	Name string
	// OtherMany is one-to-many relationship with a type called "OtherMany"
	// In order for this relationship to exists, OtherMany must have a
	// field that references a "One" type
	OtherMany []OtherMany
}

One is a struct with relation for example

type OtherMany

type OtherMany struct {
	ID   int64 `sql:"primary key;auto increment"`
	Name string
	// MyOneIs is a filed that must exists for allowing a one to many relationship
	// between a One type and OtherMany type.
	MyOne *One
}

OtherMany is another struct with relation for example

Jump to

Keyboard shortcuts

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