|
|
@@ -3,19 +3,21 @@ package sdk
|
|
|
import "github.com/fatih/structs"
|
|
|
|
|
|
type DataContainerDatabaseSpec struct {
|
|
|
- TableName string `structs:"table_name"`
|
|
|
- Columns []struct {
|
|
|
- Name string `structs:"name"`
|
|
|
- Type string `structs:"type"`
|
|
|
- Comment string `structs:"comment"`
|
|
|
- PrimaryKey bool `structs:"primary_key"`
|
|
|
- Size int `structs:"size"`
|
|
|
- Unique bool `structs:"unique"`
|
|
|
- NotNull bool `structs:"not_null"`
|
|
|
- Index bool `structs:"index"`
|
|
|
- UniqueIndex string `structs:"unique_index"`
|
|
|
- Default any `structs:"default"`
|
|
|
- } `structs:"columns"`
|
|
|
+ TableName string `structs:"table_name"`
|
|
|
+ Columns []DataContainerDatabaseColumnSpec `structs:"columns"`
|
|
|
+}
|
|
|
+
|
|
|
+type DataContainerDatabaseColumnSpec struct {
|
|
|
+ Name string `structs:"name"`
|
|
|
+ Type string `structs:"type"`
|
|
|
+ Comment string `structs:"comment"`
|
|
|
+ PrimaryKey bool `structs:"primary_key"`
|
|
|
+ Size int `structs:"size"`
|
|
|
+ Unique bool `structs:"unique"`
|
|
|
+ NotNull bool `structs:"not_null"`
|
|
|
+ Index bool `structs:"index"`
|
|
|
+ UniqueIndex string `structs:"unique_index"`
|
|
|
+ Default any `structs:"default"`
|
|
|
}
|
|
|
|
|
|
func (spec *DataContainerDatabaseSpec) ToMap() map[string]any {
|