From 20d378cd768f33f061e1c23f080c49005bfe28e7 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Thu, 12 Dec 2024 23:01:01 +0200 Subject: [PATCH] updated collection db methods godoc --- core/app.go | 4 ++-- core/collection_query.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/app.go b/core/app.go index 6b4af747..cf03d51a 100644 --- a/core/app.go +++ b/core/app.go @@ -369,7 +369,7 @@ type App interface { // - If you are updating a Collection in a transaction and then call this method before commit, // it'll return the cached Collection state and not the one from the uncommitted transaction. // - The cache is automatically updated on collections db change (create/update/delete). - // To manually reload the cache you can call [App.ReloadCachedCollections()] + // To manually reload the cache you can call [App.ReloadCachedCollections] FindCachedCollectionByNameOrId(nameOrId string) (*Collection, error) // FindCollectionReferences returns information for all relation @@ -396,7 +396,7 @@ type App interface { // - If you are updating a Collection in a transaction and then call this method before commit, // it'll return the cached Collection state and not the one from the uncommitted transaction. // - The cache is automatically updated on collections db change (create/update/delete). - // To manually reload the cache you can call [App.ReloadCachedCollections()]. + // To manually reload the cache you can call [App.ReloadCachedCollections]. FindCachedCollectionReferences(collection *Collection, excludeIds ...string) (map[*Collection][]Field, error) // IsCollectionNameUnique checks that there is no existing collection diff --git a/core/collection_query.go b/core/collection_query.go index 7ba9585d..77168a1f 100644 --- a/core/collection_query.go +++ b/core/collection_query.go @@ -76,16 +76,16 @@ func (app *BaseApp) FindCollectionByNameOrId(nameOrId string) (*Collection, erro return m, nil } -// FindCachedCollectionByNameOrId is similar to [App.FindCollectionByNameOrId] +// FindCachedCollectionByNameOrId is similar to [BaseApp.FindCollectionByNameOrId] // but retrieves the Collection from the app cache instead of making a db call. // // NB! This method is suitable for read-only Collection operations. // // Returns [sql.ErrNoRows] if no Collection is found for consistency -// with the [App.FindCollectionByNameOrId] method. +// with the [BaseApp.FindCollectionByNameOrId] method. // // If you plan making changes to the returned Collection model, -// use [App.FindCollectionByNameOrId] instead. +// use [BaseApp.FindCollectionByNameOrId] instead. // // Caveats: // @@ -95,7 +95,7 @@ func (app *BaseApp) FindCollectionByNameOrId(nameOrId string) (*Collection, erro // - If you are updating a Collection in a transaction and then call this method before commit, // it'll return the cached Collection state and not the one from the uncommitted transaction. // - The cache is automatically updated on collections db change (create/update/delete). -// To manually reload the cache you can call [App.ReloadCachedCollections()]. +// To manually reload the cache you can call [BaseApp.ReloadCachedCollections]. func (app *BaseApp) FindCachedCollectionByNameOrId(nameOrId string) (*Collection, error) { collections, _ := app.Store().Get(StoreKeyCachedCollections).([]*Collection) if collections == nil { @@ -145,13 +145,13 @@ func (app *BaseApp) FindCollectionReferences(collection *Collection, excludeIds return result, nil } -// FindCachedCollectionReferences is similar to [App.FindCollectionReferences] +// FindCachedCollectionReferences is similar to [BaseApp.FindCollectionReferences] // but retrieves the Collection from the app cache instead of making a db call. // // NB! This method is suitable for read-only Collection operations. // // If you plan making changes to the returned Collection model, -// use [App.FindCollectionReferences] instead. +// use [BaseApp.FindCollectionReferences] instead. // // Caveats: // @@ -161,7 +161,7 @@ func (app *BaseApp) FindCollectionReferences(collection *Collection, excludeIds // - If you are updating a Collection in a transaction and then call this method before commit, // it'll return the cached Collection state and not the one from the uncommitted transaction. // - The cache is automatically updated on collections db change (create/update/delete). -// To manually reload the cache you can call [App.ReloadCachedCollections()]. +// To manually reload the cache you can call [BaseApp.ReloadCachedCollections]. func (app *BaseApp) FindCachedCollectionReferences(collection *Collection, excludeIds ...string) (map[*Collection][]Field, error) { collections, _ := app.Store().Get(StoreKeyCachedCollections).([]*Collection) if collections == nil {