Documentation ¶
Index ¶
- Variables
- func Apply(flags *Flags, config *raiden.Config) error
- func FindImportResource[T any](data []T, input generator.GenerateInput, ...) (item T, found bool)
- func Import(flags *Flags, config *raiden.Config) error
- func ImportDecorateFunc[T any](data []T, findFunc func(T, generator.GenerateInput) bool, stateChan chan any) generator.GenerateFn
- func Migrate(config *raiden.Config, importState *state.LocalState, projectPath string, ...) (errors []error)
- func PreRun(projectPath string) error
- func PrintApplyChangeReport(migrateData MigrateData)
- func PrintImportReport(report ImportReport, dryRun bool)
- func RegisterModels(list ...any)
- func RegisterRole(list ...raiden.Role)
- func RegisterRpc(list ...raiden.Rpc)
- func RegisterStorages(list ...raiden.Bucket)
- func UpdateLocalStateFromApply(projectPath string, localState *state.LocalState, stateChan chan any) (done chan error)
- func UpdateLocalStateFromImport(localState *state.LocalState, stateChan chan any) (done chan error)
- type Flags
- type ImportReport
- type MigrateData
- type Resource
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplyLogger hclog.Logger = logger.HcLog().Named("apply")
View Source
var ImportLogger hclog.Logger = logger.HcLog().Named("import")
View Source
var LoadLogger hclog.Logger = logger.HcLog().Named("import.load")
View Source
var RegisteredModels []any
----- Handle register models -----
Functions ¶
func Apply ¶
Migrate resource :
[ ] migrate table
[x] create table name, schema and columns [x] create table rls enable [x] create table rls force [x] create table with primary key [x] create table with relation (ordered table by relation) [x] create table with acl (rls) [x] delete table (cascade) [x] update table name, schema [x] update table rls enable [x] update table rls force [x] update table with relation - create, update and delete (ordered table by relation) [x] create table with acl (rls), for now all rls outside manage from raiden will be delete [x] update table column add new column [x] update table column delete column [x] update table column set default schema [x] update table column set set data type [x] update table column set unique column [x] update table column set nullable
[ ] migrate role
[x] create new role [x] create role with connection limit [x] create role with inherit [ ] create role with is replicate - unsupported now because need superuser role [ ] create role with is super user - unsupported now because need superuser role [x] create role with can bypass rls, can create db, can create role, can login [x] create role with valid until [x] delete role [ ] update name [x] update connection limit [x] update inherit [ ] update is replicate [ ] update is super user [x] update can bypass rls [x] update can create db [x] update can create role [x] update can login [x] update valid until
[x] migrate function (Rpc)
[x] migrate storage
[x] create new storage [x] update storage [x] delete storage [ ] add storage acl [ ] update storage acl
func FindImportResource ¶
func FindImportResource[T any](data []T, input generator.GenerateInput, findFunc func(item T, inputData generator.GenerateInput) bool) (item T, found bool)
func Import ¶
List of import resource [x] import table, relation, column specification and acl [x] import role [x] import function [x] import storage
func ImportDecorateFunc ¶
func ImportDecorateFunc[T any](data []T, findFunc func(T, generator.GenerateInput) bool, stateChan chan any) generator.GenerateFn
func Migrate ¶
func Migrate(config *raiden.Config, importState *state.LocalState, projectPath string, resource *MigrateData) (errors []error)
func PrintApplyChangeReport ¶
func PrintApplyChangeReport(migrateData MigrateData)
func PrintImportReport ¶
func PrintImportReport(report ImportReport, dryRun bool)
func RegisterModels ¶
func RegisterModels(list ...any)
func RegisterRole ¶
func RegisterRpc ¶
func RegisterStorages ¶
func UpdateLocalStateFromApply ¶
func UpdateLocalStateFromApply(projectPath string, localState *state.LocalState, stateChan chan any) (done chan error)
func UpdateLocalStateFromImport ¶
func UpdateLocalStateFromImport(localState *state.LocalState, stateChan chan any) (done chan error)
----- Update imported data in local state -----
Types ¶
type Flags ¶
type Flags struct { ProjectPath string RpcOnly bool RolesOnly bool ModelsOnly bool StoragesOnly bool AllowedSchema string DebugMode bool TraceMode bool Generate generate.Flags UpdateStateOnly bool DryRun bool }
Flags is struct to binding options when import and apply is run binart
func (Flags) CheckAndActivateDebug ¶
type ImportReport ¶
----- Print import report -----
type MigrateData ¶
type MigrateData struct { Tables []tables.MigrateItem Roles []roles.MigrateItem Rpc []rpc.MigrateItem Policies []policies.MigrateItem Storages []storages.MigrateItem }
Click to show internal directories.
Click to hide internal directories.