|
|
@@ -0,0 +1,32 @@
|
|
|
+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"`
|
|
|
+}
|
|
|
+
|
|
|
+func (spec *DataContainerDatabaseSpec) ToMap() map[string]any {
|
|
|
+ return structs.Map(spec)
|
|
|
+}
|
|
|
+
|
|
|
+type SqlSpec struct {
|
|
|
+ Transaction bool `structs:"transaction"`
|
|
|
+ Clauses string `structs:"clauses"`
|
|
|
+}
|
|
|
+
|
|
|
+func (spec *SqlSpec) ToMap() map[string]any {
|
|
|
+ return structs.Map(spec)
|
|
|
+}
|