Skip to content

Commit

Permalink
detail models
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdWaterLW committed May 12, 2022
1 parent 543ab04 commit 4037a2a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions sqle/model/sql_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"database/sql/driver"
"encoding/json"
"fmt"
"time"
)

type SqlQueryConfig struct {
Expand Down Expand Up @@ -40,11 +41,18 @@ func (c SqlQueryConfig) Value() (driver.Value, error) {

type SqlQueryHistory struct {
Model
RawSql string `json:"raw_sql" gorm:"type:text;not null"`
CreateUserId uint `json:"create_user_id" gorm:"not null"`
InstanceId uint `json:"instance_id" gorm:"not null"`
Database string `json:"database"`
RawSql string `json:"raw_sql" gorm:"type:text;not null"`
}

type SqlQueryExecutionSql struct {
Model
Sql string `json:"sql" gorm:"type:text;not null"`
InstanceId uint `json:"instance_id" gorm:"not null"`
SqlQueryHistoryId uint `json:"sql_query_history_id" gorm:"not null"`
Sql string `json:"sql" gorm:"type:text;not null"`
ExecStartAt *time.Time `json:"exec_start_at"`
ExecEndAt *time.Time `json:"exec_end_at"`
ExecResult string `json:"exec_result" gorm:"type:text"`
RawSqlInfo SqlQueryHistory `json:"raw_sql_info" gorm:"foreignkey:SqlQueryHistoryId"`
}

0 comments on commit 4037a2a

Please sign in to comment.