Documentation
¶
Index ¶
- Constants
- Variables
- type Activity
- type ActivityTables
- type CSVExportSpec
- type Commit
- type Config
- type CustomExportSpec
- type Database
- type DatabaseDriver
- type ExpectingDatabaseDriver
- type ExportSpecTransform
- type ExporterName
- type GRPCCrudExportSpec
- type GoEntitiesExportSpec
- type GoEntityRepositorySpec
- type GoEntityRepositorySpecRepoInterfacesPlace
- type JSONSchemaExportSpec
- type LaravelModelsExportSpec
- type Loader
- type MarkdownExportSpec
- type MigrationsSpec
- type Parser
- type Task
- type ValidatableSpec
Constants ¶
View Source
const ( GoEntityRepositorySpecRepoInterfacesPlaceUnspecified = "" GoEntityRepositorySpecRepoInterfacesPlaceWithEntity = "with_entity" GoEntityRepositorySpecRepoInterfacesPlaceWithRepository = "with_repository" GoEntityRepositorySpecRepoInterfacesPlaceEntity = "entity" )
View Source
const (
DefaultDatabaseSchema = "public"
)
Variables ¶
View Source
var DatabaseDrivers = []DatabaseDriver{ DatabaseDriverPostgres, DatabaseDriverDBML, DatabaseDriverMySQL, }
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct {
Database string `yaml:"database" json:"database"`
Tables ActivityTables `yaml:"tables" json:"tables"`
Format ExporterName `yaml:"format" json:"format"`
TablePerFile bool `yaml:"table_per_file" json:"table_per_file"`
SkipExists bool `yaml:"skip_exists" json:"skip_exists"`
Out struct {
Dir string `yaml:"dir" json:"dir"`
FilePrefix string `yaml:"file_prefix" json:"file_prefix"`
} `yaml:"out" json:"out"`
Spec interface{} `yaml:"-" json:"spec"`
}
func (*Activity) UnmarshalYAML ¶
type ActivityTables ¶
type CSVExportSpec ¶
type CSVExportSpec struct {
Delimiter string `yaml:"delimiter" json:"delimiter"`
Transform map[string][]ExportSpecTransform `yaml:"transform" json:"transform"`
}
type Commit ¶
type Config ¶
type Config struct {
Databases map[string]Database `yaml:"databases"`
Tasks map[string]Task `yaml:"tasks"`
Options struct {
WithMigrationsTable bool `yaml:"with_migrations_table"`
PrintStat bool `yaml:"print_stat"`
Debug bool `yaml:"debug"`
} `yaml:"options"`
}
func (*Config) GetDefaultDatabaseName ¶
type CustomExportSpec ¶ added in v0.5.0
type CustomExportSpec struct {
Template string `yaml:"template" json:"template"`
Output struct {
Extension string `yaml:"extension" json:"extension"`
} `yaml:"output" json:"output"`
}
func (*CustomExportSpec) Validate ¶ added in v0.5.0
func (s *CustomExportSpec) Validate() error
type Database ¶
type Database struct {
Driver DatabaseDriver `yaml:"driver"`
DSN string `yaml:"dsn"`
Schema string `yaml:"schema"`
}
type DatabaseDriver ¶
type DatabaseDriver string
const ( DatabaseDriverPostgres DatabaseDriver = "postgres" DatabaseDriverDBML DatabaseDriver = "dbml" DatabaseDriverMySQL DatabaseDriver = "mysql" )
func (DatabaseDriver) CanMigrate ¶ added in v0.4.0
func (d DatabaseDriver) CanMigrate() bool
func (DatabaseDriver) CanRead ¶ added in v0.4.0
func (d DatabaseDriver) CanRead() bool
func (DatabaseDriver) CanWrite ¶ added in v0.4.0
func (d DatabaseDriver) CanWrite() bool
func (DatabaseDriver) Valid ¶
func (d DatabaseDriver) Valid() bool
type ExpectingDatabaseDriver ¶ added in v0.5.0
type ExpectingDatabaseDriver interface {
InjectDatabaseDriver(driver DatabaseDriver)
}
type ExportSpecTransform ¶
type ExporterName ¶
type ExporterName string
const ( ExporterNameMd ExporterName = "md" ExporterNameDiagram ExporterName = "diagram" ExporterNameGoEntities ExporterName = "go-entities" ExporterNameGoEntityRepository ExporterName = "go-entity-repository" ExporterNameGoose ExporterName = "goose" ExporterNameGooseFixtures ExporterName = "goose-fixtures" ExporterNameGoSQLMigrate ExporterName = "go-sql-migrate" ExporterNameDDL ExporterName = "ddl" ExporterNameLaravelMigrationsRaw ExporterName = "laravel-migrations-raw" ExporterNameLaravelModels ExporterName = "laravel-models" ExporterNameGrpcCrud ExporterName = "grpc-crud" ExporterNameCSV ExporterName = "csv" ExporterNameJSONSchema ExporterName = "json-schema" ExporterNameGraphql ExporterName = "graphql" ExporterNameDBML ExporterName = "dbml" ExporterNameCustom ExporterName = "custom" )
type GRPCCrudExportSpec ¶
type GRPCCrudExportSpec struct {
Package string `yaml:"package" json:"package"`
Options orderedmap.OrderedMap[string, interface{}] `yaml:"options" json:"options"`
}
type GoEntitiesExportSpec ¶
type GoEntityRepositorySpec ¶
type GoEntityRepositorySpec struct {
GoModule string `yaml:"go_module" json:"go_module"`
Entities struct {
Package string `yaml:"package" json:"package"`
} `yaml:"entities" json:"entities"`
Repositories struct {
Package string `yaml:"package" json:"package"`
Container struct {
StructName string `yaml:"struct_name" json:"struct_name"`
} `yaml:"container" json:"container"`
Interfaces struct {
Place GoEntityRepositorySpecRepoInterfacesPlace `yaml:"place" json:"place"`
WithMocks bool `yaml:"with_mocks" json:"with_mocks"`
} `yaml:"interfaces" json:"interfaces"`
} `yaml:"repositories" json:"repositories"`
}
type GoEntityRepositorySpecRepoInterfacesPlace ¶
type GoEntityRepositorySpecRepoInterfacesPlace string
type JSONSchemaExportSpec ¶
type LaravelModelsExportSpec ¶
type MarkdownExportSpec ¶
type MarkdownExportSpec struct {
WithDiagram bool `yaml:"with_diagram" json:"with_diagram"`
}
type MigrationsSpec ¶
type MigrationsSpec struct {
Use struct {
IfNotExists bool `yaml:"if_not_exists" json:"if_not_exists"`
IfExists bool `yaml:"if_exists" json:"if_exists"`
} `yaml:"use"`
Target DatabaseDriver `yaml:"target" json:"target"`
}
func (*MigrationsSpec) InjectDatabaseDriver ¶ added in v0.5.0
func (m *MigrationsSpec) InjectDatabaseDriver(driver DatabaseDriver)
func (*MigrationsSpec) Validate ¶ added in v0.4.0
func (m *MigrationsSpec) Validate() error
type ValidatableSpec ¶ added in v0.4.0
type ValidatableSpec interface {
Validate() error
}
Click to show internal directories.
Click to hide internal directories.