mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
feat: Update database models to use DatabaseV2 instead of DataSourceV2
This commit updates the database models and related functions to use the new DatabaseV2 struct instead of the deprecated DataSourceV2 struct. This change ensures consistency and clarity in the codebase.
This commit is contained in:
25
core/entity/database.go
Normal file
25
core/entity/database.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package entity
|
||||
|
||||
type DatabaseMetadata struct {
|
||||
Databases []Database `json:"databases"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
Name string `json:"name"`
|
||||
Tables []DatabaseTable `json:"tables"`
|
||||
}
|
||||
|
||||
type DatabaseTable struct {
|
||||
Name string `json:"name"`
|
||||
Columns []DatabaseColumn `json:"columns"`
|
||||
}
|
||||
|
||||
type DatabaseColumn struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Null bool `json:"null,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Default string `json:"default,omitempty"`
|
||||
Extra string `json:"extra,omitempty"`
|
||||
Children []DatabaseColumn `json:"children,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user