Documentation ¶
Index ¶
- Variables
- type Bytes
- type Extra
- func (s *Extra) HasPK() bool
- func (s *Extra) PKPointer() interface{}
- func (s *Extra) PKValue() interface{}
- func (s *Extra) Pointers() []interface{}
- func (s *Extra) SetPK(pk interface{})
- func (s Extra) String() string
- func (s *Extra) Table() reform.Table
- func (s *Extra) Values() []interface{}
- func (s *Extra) View() reform.View
- type IDOnly
- func (s *IDOnly) HasPK() bool
- func (s *IDOnly) PKPointer() interface{}
- func (s *IDOnly) PKValue() interface{}
- func (s *IDOnly) Pointers() []interface{}
- func (s *IDOnly) SetPK(pk interface{})
- func (s IDOnly) String() string
- func (s *IDOnly) Table() reform.Table
- func (s *IDOnly) Values() []interface{}
- func (s *IDOnly) View() reform.View
- type Integer
- type LegacyPerson
- func (s *LegacyPerson) HasPK() bool
- func (s *LegacyPerson) PKPointer() interface{}
- func (s *LegacyPerson) PKValue() interface{}
- func (s *LegacyPerson) Pointers() []interface{}
- func (s *LegacyPerson) SetPK(pk interface{})
- func (s LegacyPerson) String() string
- func (s *LegacyPerson) Table() reform.Table
- func (s *LegacyPerson) Values() []interface{}
- func (s *LegacyPerson) View() reform.View
- type Person
- func (p *Person) AfterFind() error
- func (p *Person) BeforeInsert() error
- func (p *Person) BeforeUpdate() error
- func (s *Person) HasPK() bool
- func (s *Person) PKPointer() interface{}
- func (s *Person) PKValue() interface{}
- func (s *Person) Pointers() []interface{}
- func (s *Person) SetPK(pk interface{})
- func (s Person) String() string
- func (s *Person) Table() reform.Table
- func (s *Person) Values() []interface{}
- func (s *Person) View() reform.View
- type PersonProject
- type Project
- func (p *Project) AfterFind() error
- func (p *Project) BeforeInsert() error
- func (p *Project) BeforeUpdate() error
- func (s *Project) HasPK() bool
- func (s *Project) PKPointer() interface{}
- func (s *Project) PKValue() interface{}
- func (s *Project) Pointers() []interface{}
- func (s *Project) SetPK(pk interface{})
- func (s Project) String() string
- func (s *Project) Table() reform.Table
- func (s *Project) Values() []interface{}
- func (s *Project) View() reform.View
- type String
- type Uint8s
Constants ¶
This section is empty.
Variables ¶
var ExtraTable = &extraTableType{ s: parse.StructInfo{Type: "Extra", SQLSchema: "", SQLName: "extra", Fields: []parse.FieldInfo{{Name: "ID", Type: "Integer", Column: "id"}, {Name: "Name", Type: "*String", Column: "name"}, {Name: "Byte", Type: "uint8", Column: "byte"}, {Name: "Uint8", Type: "uint8", Column: "uint8"}, {Name: "ByteP", Type: "*uint8", Column: "bytep"}, {Name: "Uint8P", Type: "*uint8", Column: "uint8p"}, {Name: "Bytes", Type: "[]uint8", Column: "bytes"}, {Name: "Uint8s", Type: "[]uint8", Column: "uint8s"}, {Name: "BytesA", Type: "[512]uint8", Column: "bytesa"}, {Name: "Uint8sA", Type: "[512]uint8", Column: "uint8sa"}, {Name: "BytesT", Type: "Bytes", Column: "bytest"}, {Name: "Uint8sT", Type: "Uint8s", Column: "uint8st"}}, PKFieldIndex: 0}, z: new(Extra).Values(), }
ExtraTable represents extra view or table in SQL database.
var IDOnlyTable = &iDOnlyTableType{ s: parse.StructInfo{Type: "IDOnly", SQLSchema: "", SQLName: "id_only", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}}, PKFieldIndex: 0}, z: new(IDOnly).Values(), }
IDOnlyTable represents id_only view or table in SQL database.
var LegacyPersonTable = &legacyPersonTableType{ s: parse.StructInfo{Type: "LegacyPerson", SQLSchema: "legacy", SQLName: "people", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Name", Type: "*string", Column: "name"}}, PKFieldIndex: 0}, z: new(LegacyPerson).Values(), }
LegacyPersonTable represents people view or table in SQL database.
var PersonProjectView = &personProjectViewType{ s: parse.StructInfo{Type: "PersonProject", SQLSchema: "", SQLName: "person_project", Fields: []parse.FieldInfo{{Name: "PersonID", Type: "int32", Column: "person_id"}, {Name: "ProjectID", Type: "string", Column: "project_id"}}, PKFieldIndex: -1}, z: new(PersonProject).Values(), }
PersonProjectView represents person_project view or table in SQL database.
var PersonTable = &personTableType{ s: parse.StructInfo{Type: "Person", SQLSchema: "", SQLName: "people", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "GroupID", Type: "*int32", Column: "group_id"}, {Name: "Name", Type: "string", Column: "name"}, {Name: "Email", Type: "*string", Column: "email"}, {Name: "CreatedAt", Type: "time.Time", Column: "created_at"}, {Name: "UpdatedAt", Type: "*time.Time", Column: "updated_at"}}, PKFieldIndex: 0}, z: new(Person).Values(), }
PersonTable represents people view or table in SQL database.
var ProjectTable = &projectTableType{ s: parse.StructInfo{Type: "Project", SQLSchema: "", SQLName: "projects", Fields: []parse.FieldInfo{{Name: "Name", Type: "string", Column: "name"}, {Name: "ID", Type: "string", Column: "id"}, {Name: "Start", Type: "time.Time", Column: "start"}, {Name: "End", Type: "*time.Time", Column: "end"}}, PKFieldIndex: 1}, z: new(Project).Values(), }
ProjectTable represents projects view or table in SQL database.
Functions ¶
This section is empty.
Types ¶
type Extra ¶ added in v1.1.1
type Extra struct { ID Integer `reform:"id,pk"` // UUID uuid.UUID `reform:"uuid"` Name *String `reform:"name"` Ignored1 string Ignored2 string `reform:""` Ignored3 string `reform:"-"` Byte byte `reform:"byte"` Uint8 uint8 `reform:"uint8"` ByteP *byte `reform:"bytep"` Uint8P *uint8 `reform:"uint8p"` Bytes []byte `reform:"bytes"` Uint8s []uint8 `reform:"uint8s"` BytesA [512]byte `reform:"bytesa"` Uint8sA [512]uint8 `reform:"uint8sa"` BytesT Bytes `reform:"bytest"` Uint8sT Uint8s `reform:"uint8st"` }
func (*Extra) HasPK ¶ added in v1.1.1
HasPK returns true if record has non-zero primary key set, false otherwise.
func (*Extra) PKPointer ¶ added in v1.1.1
func (s *Extra) PKPointer() interface{}
PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.
func (*Extra) PKValue ¶ added in v1.1.1
func (s *Extra) PKValue() interface{}
PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.
func (*Extra) Pointers ¶ added in v1.1.1
func (s *Extra) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (*Extra) SetPK ¶ added in v1.1.1
func (s *Extra) SetPK(pk interface{})
SetPK sets record primary key.
func (Extra) String ¶ added in v1.1.1
String returns a string representation of this struct or record.
func (*Extra) Table ¶ added in v1.1.1
func (s *Extra) Table() reform.Table
Table returns Table object for that record.
type IDOnly ¶ added in v1.2.0
type IDOnly struct {
ID int32 `reform:"id,pk"`
}
reform:id_only
func (*IDOnly) HasPK ¶ added in v1.2.0
HasPK returns true if record has non-zero primary key set, false otherwise.
func (*IDOnly) PKPointer ¶ added in v1.2.0
func (s *IDOnly) PKPointer() interface{}
PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.
func (*IDOnly) PKValue ¶ added in v1.2.0
func (s *IDOnly) PKValue() interface{}
PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.
func (*IDOnly) Pointers ¶ added in v1.2.0
func (s *IDOnly) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (*IDOnly) SetPK ¶ added in v1.2.0
func (s *IDOnly) SetPK(pk interface{})
SetPK sets record primary key.
func (IDOnly) String ¶ added in v1.2.0
String returns a string representation of this struct or record.
func (*IDOnly) Table ¶ added in v1.2.0
func (s *IDOnly) Table() reform.Table
Table returns Table object for that record.
type LegacyPerson ¶
func (*LegacyPerson) HasPK ¶
func (s *LegacyPerson) HasPK() bool
HasPK returns true if record has non-zero primary key set, false otherwise.
func (*LegacyPerson) PKPointer ¶
func (s *LegacyPerson) PKPointer() interface{}
PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.
func (*LegacyPerson) PKValue ¶
func (s *LegacyPerson) PKValue() interface{}
PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.
func (*LegacyPerson) Pointers ¶
func (s *LegacyPerson) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (*LegacyPerson) SetPK ¶
func (s *LegacyPerson) SetPK(pk interface{})
SetPK sets record primary key.
func (LegacyPerson) String ¶
func (s LegacyPerson) String() string
String returns a string representation of this struct or record.
func (*LegacyPerson) Table ¶
func (s *LegacyPerson) Table() reform.Table
Table returns Table object for that record.
func (*LegacyPerson) Values ¶
func (s *LegacyPerson) Values() []interface{}
Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.
func (*LegacyPerson) View ¶
func (s *LegacyPerson) View() reform.View
View returns View object for that struct.
type Person ¶
type Person struct { ID int32 `reform:"id,pk"` GroupID *int32 `reform:"group_id"` Name string `reform:"name"` Email *string `reform:"email"` CreatedAt time.Time `reform:"created_at"` UpdatedAt *time.Time `reform:"updated_at"` }
func (*Person) AfterFind ¶
AfterFind converts to UTC and truncates to second both CreatedAt and UpdatedAt.
func (*Person) BeforeInsert ¶
BeforeInsert sets CreatedAt if it's not set, then converts to UTC, truncates to second and strips monotonic clock reading from both CreatedAt and UpdatedAt.
func (*Person) BeforeUpdate ¶
BeforeUpdate sets CreatedAt if it's not set, sets UpdatedAt, then converts to UTC, truncates to second and strips monotonic clock reading from both CreatedAt and UpdatedAt.
func (*Person) PKPointer ¶
func (s *Person) PKPointer() interface{}
PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.
func (*Person) PKValue ¶
func (s *Person) PKValue() interface{}
PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.
func (*Person) Pointers ¶
func (s *Person) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (*Person) Table ¶
func (s *Person) Table() reform.Table
Table returns Table object for that record.
type PersonProject ¶
type PersonProject struct { PersonID int32 `reform:"person_id"` ProjectID string `reform:"project_id"` }
PersonProject represents row in table person_project. reform:person_project
func (*PersonProject) Pointers ¶
func (s *PersonProject) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (PersonProject) String ¶
func (s PersonProject) String() string
String returns a string representation of this struct or record.
func (*PersonProject) Values ¶
func (s *PersonProject) Values() []interface{}
Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.
func (*PersonProject) View ¶
func (s *PersonProject) View() reform.View
View returns View object for that struct.
type Project ¶
type Project struct { Name string `reform:"name"` ID string `reform:"id,pk"` Start time.Time `reform:"start"` End *time.Time `reform:"end"` }
Project represents row in table projects (reform:projects).
func (*Project) BeforeInsert ¶
BeforeInsert converts to UTC, truncates to day and strips monotonic clock reading from both Start and End.
func (*Project) BeforeUpdate ¶
BeforeUpdate converts to UTC, truncates to day and strips monotonic clock reading from both Start and End.
func (*Project) PKPointer ¶
func (s *Project) PKPointer() interface{}
PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.
func (*Project) PKValue ¶
func (s *Project) PKValue() interface{}
PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.
func (*Project) Pointers ¶
func (s *Project) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (*Project) Table ¶
func (s *Project) Table() reform.Table
Table returns Table object for that record.