-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update models to use DatabaseV2 instead of DataSourceV2
- Loading branch information
Showing
3 changed files
with
50 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,46 @@ | ||
package models | ||
|
||
import "time" | ||
|
||
type DatabaseV2 struct { | ||
any `collection:"databases"` | ||
BaseModelV2[DatabaseV2] `bson:",inline"` | ||
Name string `json:"name" bson:"name"` | ||
DataSource string `json:"data_source" bson:"data_source"` | ||
Type string `json:"type" bson:"type"` | ||
Description string `json:"description" bson:"description"` | ||
Host string `json:"host" bson:"host"` | ||
Port int `json:"port" bson:"port"` | ||
Url string `json:"url" bson:"url"` | ||
Database string `json:"database" bson:"database"` | ||
Username string `json:"username" bson:"username"` | ||
Password string `json:"-,omitempty" bson:"password"` | ||
ConnectType string `json:"connect_type" bson:"connect_type"` | ||
Status string `json:"status" bson:"status"` | ||
Error string `json:"error" bson:"error"` | ||
Extra map[string]string `json:"extra,omitempty" bson:"extra,omitempty"` | ||
Name string `json:"name" bson:"name"` | ||
DataSource string `json:"data_source" bson:"data_source"` | ||
Type string `json:"type" bson:"type"` | ||
Description string `json:"description" bson:"description"` | ||
Host string `json:"host" bson:"host"` | ||
Port int `json:"port" bson:"port"` | ||
URI string `json:"uri,omitempty" bson:"uri,omitempty"` | ||
Database string `json:"database,omitempty" bson:"database,omitempty"` | ||
Username string `json:"username,omitempty" bson:"username,omitempty"` | ||
Password string `json:"-,omitempty" bson:"password,omitempty"` | ||
ConnectType string `json:"connect_type,omitempty" bson:"connect_type,omitempty"` | ||
Status string `json:"status" bson:"status"` | ||
Error string `json:"error" bson:"error"` | ||
Active bool `json:"active" bson:"active"` | ||
ActiveAt time.Time `json:"active_ts" bson:"active_ts"` | ||
|
||
MongoParams *struct { | ||
AuthSource string `json:"auth_source,omitempty" bson:"auth_source,omitempty"` | ||
AuthMechanism string `json:"auth_mechanism,omitempty" bson:"auth_mechanism,omitempty"` | ||
} `json:"mongo_params,omitempty" bson:"mongo_params,omitempty"` | ||
PostgresParams *struct { | ||
SSLMode string `json:"ssl_mode,omitempty" bson:"ssl_mode,omitempty"` | ||
} `json:"postgres_params,omitempty" bson:"postgres_params,omitempty"` | ||
SnowflakeParams *struct { | ||
Account string `json:"account,omitempty" bson:"account,omitempty"` | ||
Schema string `json:"schema,omitempty" bson:"schema,omitempty"` | ||
Warehouse string `json:"warehouse,omitempty" bson:"warehouse,omitempty"` | ||
Role string `json:"role,omitempty" bson:"role,omitempty"` | ||
} `json:"snowflake_params,omitempty" bson:"snowflake_params,omitempty"` | ||
CassandraParams *struct { | ||
Keyspace string `json:"keyspace,omitempty" bson:"keyspace,omitempty"` | ||
} | ||
HiveParams *struct { | ||
Auth string `json:"auth,omitempty" bson:"auth,omitempty"` | ||
} | ||
RedisParams *struct { | ||
DB int `json:"db,omitempty" bson:"db,omitempty"` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters