Documentation
¶
Overview ¶
Package dberd provides functionality for database schema extraction, formatting, and rendering.
Index ¶
- func NewUnsupportedFormatError(given, expected TargetType) error
- type Column
- type FormattedSchema
- type Reference
- type Schema
- type SchemaExtractor
- type SchemaFormatter
- type SchemaRenderer
- type Source
- type Table
- type TableColumn
- type Target
- type TargetCapabilities
- type TargetType
- type UnsupportedFormatError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewUnsupportedFormatError ¶
func NewUnsupportedFormatError(given, expected TargetType) error
NewUnsupportedFormatError creates a new UnsupportedFormatError.
Types ¶
type Column ¶
type Column struct {
Name string `json:"name"`
Comment string `json:"comment,omitempty"`
Definition string `json:"definition"`
IsPrimary bool `json:"is_primary"`
}
Column represents a database table column.
type FormattedSchema ¶
type FormattedSchema struct {
Type TargetType `json:"type"`
Data []byte `json:"data"`
}
FormattedSchema represents a formatted database schema.
type Reference ¶
type Reference struct {
Source TableColumn `json:"source"`
Target TableColumn `json:"target"`
}
Reference represents a foreign key relationship between two table columns.
type SchemaExtractor ¶
SchemaExtractor defines the interface for extracting database schema.
type SchemaFormatter ¶
type SchemaFormatter interface {
FormatSchema(ctx context.Context, s Schema) (FormattedSchema, error)
}
SchemaFormatter defines the interface for formatting database schema.
type SchemaRenderer ¶
type SchemaRenderer interface {
RenderSchema(ctx context.Context, fs FormattedSchema) ([]byte, error)
}
SchemaRenderer defines the interface for rendering formatted database schema.
type Source ¶
type Source interface {
SchemaExtractor
io.Closer
}
Source defines the interface for database schema sources that can extract schema information.
type TableColumn ¶
TableColumn represents a reference to a specific column in a table.
type Target ¶
type Target interface {
SchemaFormatter
SchemaRenderer
Capabilities() TargetCapabilities
}
Target defines the interface for database schema targets that can format and render schema information.
type TargetCapabilities ¶
TargetCapabilities represents the capabilities of a Target implementation.
type TargetType ¶
type TargetType string
TargetType represents the type of language for describing database schema.
type UnsupportedFormatError ¶
type UnsupportedFormatError struct {
// contains filtered or unexported fields
}
UnsupportedFormatError represents an error when an unsupported format is provided.
func (*UnsupportedFormatError) Error ¶
func (err *UnsupportedFormatError) Error() string
Error implements the error interface for UnsupportedFormatError.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
dberd
command
|
|
|
source
|
|
|
clickhouse
Package clickhouse provides functionality for extracting database schema information from ClickHouse databases.
|
Package clickhouse provides functionality for extracting database schema information from ClickHouse databases. |
|
cockroach
Package cockroach provides functionality for extracting database schema information from CockroachDB databases.
|
Package cockroach provides functionality for extracting database schema information from CockroachDB databases. |
|
mongodb
Package mongodb provides functionality for extracting database schema information from MongoDB databases.
|
Package mongodb provides functionality for extracting database schema information from MongoDB databases. |
|
mysql
Package mysql provides functionality for extracting database schema information from MySQL databases.
|
Package mysql provides functionality for extracting database schema information from MySQL databases. |
|
postgres
Package postgres provides functionality for extracting database schema information from PostgreSQL databases.
|
Package postgres provides functionality for extracting database schema information from PostgreSQL databases. |
|
target
|
|
|
d2
Package d2 provides functionality for converting database schemas into D2 diagram format.
|
Package d2 provides functionality for converting database schemas into D2 diagram format. |
|
json
Package json provides functionality for formatting database schemas as JSON.
|
Package json provides functionality for formatting database schemas as JSON. |
|
mermaid
Package mermaid provides functionality for converting database schemas into Mermaid JS ERD format.
|
Package mermaid provides functionality for converting database schemas into Mermaid JS ERD format. |
|
plantuml
Package plantuml provides functionality for converting database schemas into PlantUML ERD format.
|
Package plantuml provides functionality for converting database schemas into PlantUML ERD format. |