Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEntityManagerWithConfig ¶
func NewEntityManagerWithConfig(config *forma.Config, pool *pgxpool.Pool) (forma.EntityManager, error)
NewEntityManagerWithConfig creates a new EntityManager with the provided configuration and database pool. This is the primary way for external projects to create an EntityManager instance.
If config.SchemaRegistry is provided, it will be used instead of creating a file-based registry. This allows callers to provide their own SchemaRegistry implementation.
Usage:
import (
"github.com/lychee-technology/forma" "github.com/lychee-technology/forma/factory"
)
config := forma.DefaultConfig() em, err := factory.NewEntityManagerWithConfig(config, pool)
if err != nil {
// handle error
}
With custom SchemaRegistry:
config := forma.DefaultConfig() config.SchemaRegistry = myCustomRegistry em, err := factory.NewEntityManagerWithConfig(config, pool)
func NewFileSchemaRegistry ¶ added in v0.0.15
Types ¶
This section is empty.