mirror of
https://github.com/safing/portbase
synced 2025-09-17 02:29:50 +00:00
Improve database meta handling
This commit is contained in:
parent
0e2733a342
commit
1133c78f85
5 changed files with 24 additions and 9 deletions
|
@ -57,6 +57,14 @@ func (b *Base) CreateMeta() {
|
|||
b.meta = &Meta{}
|
||||
}
|
||||
|
||||
// UpdateMeta creates the metadata if it does not exist and updates it.
|
||||
func (b *Base) UpdateMeta() {
|
||||
if b.meta == nil {
|
||||
b.meta = &Meta{}
|
||||
}
|
||||
b.meta.Update()
|
||||
}
|
||||
|
||||
// SetMeta sets the metadata on the database record, it should only be called after loading the record. Use MoveTo to save the record with another key.
|
||||
func (b *Base) SetMeta(meta *Meta) {
|
||||
b.meta = meta
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue