Documentation ¶
Index ¶
- Constants
- Variables
- func BuildGenerateModelInputs(tables []objects.Table, policies objects.Policies, ...) []*generator.GenerateModelInput
- func Compare(source []objects.Table, target []objects.Table) error
- func GenerateDiffChangeMessage(newTable []string, updateTable []string, deleteTable []string) (string, error)
- func GenerateDiffChangeUpdateMessage(name string, item MigrateItem) (string, error)
- func GenerateDiffMessage(diffData CompareDiffResult, sRelation MapRelations, tRelation MapRelations) (string, error)
- func GetDiffChangeMessage(items []MigrateItem) string
- func GetNewCountData(supabaseData []objects.Table, localData state.ExtractTableResult) int
- func Migrate(config *raiden.Config, tables []MigrateItem, stateChan chan any, ...) []error
- func PrintDiff(diffData CompareDiffResult, sRelation MapRelations, tRelation MapRelations)
- func PrintDiffResult(diffResult []CompareDiffResult, sRelation MapRelations, tRelation MapRelations) error
- type CompareDiffResult
- type ManyToManyTable
- type MapRelations
- type MapTable
- type MigrateActionFunc
- type MigrateItem
Constants ¶
View Source
const DiffChangeTemplate = `` /* 330-byte string literal not displayed */
View Source
const DiffChangeUpdateTemplate = `` /* 441-byte string literal not displayed */
View Source
const DiffTemplate = `
{{- .Columns}}
{{- .Metadata}}
{{- .Acl}}
{{- .Relations}}
`
----- generate message section ------
Variables ¶
View Source
var ActionFunc = MigrateActionFunc{ CreateFunc: supabase.CreateTable, UpdateFunc: supabase.UpdateTable, DeleteFunc: func(cfg *raiden.Config, param objects.Table) (err error) { return supabase.DeleteTable(cfg, param, true) }, }
View Source
var Logger hclog.Logger = logger.HcLog().Named("resource.tables")
Functions ¶
func BuildGenerateModelInputs ¶
func BuildGenerateModelInputs(tables []objects.Table, policies objects.Policies, mapModelValidationTags map[string]state.ModelValidationTag) []*generator.GenerateModelInput
func GenerateDiffChangeUpdateMessage ¶
func GenerateDiffChangeUpdateMessage(name string, item MigrateItem) (string, error)
func GenerateDiffMessage ¶
func GenerateDiffMessage(diffData CompareDiffResult, sRelation MapRelations, tRelation MapRelations) (string, error)
func GetDiffChangeMessage ¶
func GetDiffChangeMessage(items []MigrateItem) string
func GetNewCountData ¶
func GetNewCountData(supabaseData []objects.Table, localData state.ExtractTableResult) int
func Migrate ¶
func Migrate(config *raiden.Config, tables []MigrateItem, stateChan chan any, actions MigrateActionFunc) []error
func PrintDiff ¶
func PrintDiff(diffData CompareDiffResult, sRelation MapRelations, tRelation MapRelations)
func PrintDiffResult ¶
func PrintDiffResult(diffResult []CompareDiffResult, sRelation MapRelations, tRelation MapRelations) error
Types ¶
type CompareDiffResult ¶
type CompareDiffResult struct { Name string SourceResource objects.Table TargetResource objects.Table DiffItems objects.UpdateTableParam IsConflict bool }
func CompareItem ¶
func CompareItem(source, target objects.Table) (diffResult CompareDiffResult)
func CompareList ¶
func CompareList(sourceTable, targetTable []objects.Table) (diffResult []CompareDiffResult, err error)
type ManyToManyTable ¶
type ManyToManyTable struct { Table string Schema string PivotTable string PrimaryKey string ForeignKey string }
---- build table relation for generated -----
type MapRelations ¶
---- build table relation for generated -----
type MigrateActionFunc ¶
type MigrateActionFunc = migrator.MigrateActionFunc[objects.Table, objects.UpdateTableParam]
type MigrateItem ¶
type MigrateItem = migrator.MigrateItem[objects.Table, objects.UpdateTableParam]
func BuildMigrateData ¶
func BuildMigrateData(extractedLocalData state.ExtractTableResult, supabaseData []objects.Table) (migrateData []MigrateItem, err error)
func BuildMigrateItem ¶
func BuildMigrateItem(supabaseData, localData []objects.Table) (migratedData []MigrateItem, err error)
Click to show internal directories.
Click to hide internal directories.