added logging capability
This commit is contained in:
parent
be081e6e75
commit
9f1f7476ab
123
db.go
123
db.go
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -14,8 +13,11 @@ import (
|
|||||||
|
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
"github.com/lib/pq"
|
"github.com/lib/pq"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var log zerolog.Logger
|
||||||
|
|
||||||
type Db struct {
|
type Db struct {
|
||||||
Driver string
|
Driver string
|
||||||
Url string
|
Url string
|
||||||
@ -49,7 +51,7 @@ func Open(driver string, url string) *Db {
|
|||||||
database.Url = url
|
database.Url = url
|
||||||
database.conn, err = sql.Open(driver, url)
|
database.conn, err = sql.Open(driver, url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
}
|
}
|
||||||
return &database
|
return &database
|
||||||
}
|
}
|
||||||
@ -73,10 +75,13 @@ func (t *TableInfo) GetAssociativeArray(columns []string, restriction string, so
|
|||||||
|
|
||||||
// QueryAssociativeArray : Provide query result as an associative array
|
// QueryAssociativeArray : Provide query result as an associative array
|
||||||
func (db *Db) QueryAssociativeArray(query string) (Rows, error) {
|
func (db *Db) QueryAssociativeArray(query string) (Rows, error) {
|
||||||
|
if db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
rows, err := db.conn.Query(query)
|
rows, err := db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
log.Println(query)
|
log.Error().Msg(query)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
@ -84,8 +89,8 @@ func (db *Db) QueryAssociativeArray(query string) (Rows, error) {
|
|||||||
results := Rows{}
|
results := Rows{}
|
||||||
cols, err := rows.Columns()
|
cols, err := rows.Columns()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
log.Println(query)
|
log.Error().Msg(query)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// make types map
|
// make types map
|
||||||
@ -191,7 +196,7 @@ func (t *TableInfo) GetSchema() (*TableInfo, error) {
|
|||||||
}
|
}
|
||||||
cols, err := t.db.QueryAssociativeArray(schemaQuery)
|
cols, err := t.db.QueryAssociativeArray(schemaQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
ti.Columns = make(map[string]string)
|
ti.Columns = make(map[string]string)
|
||||||
@ -221,7 +226,7 @@ func (db *Db) GetSchema() ([]TableInfo, error) {
|
|||||||
var res []TableInfo
|
var res []TableInfo
|
||||||
tables, err := db.ListTables()
|
tables, err := db.ListTables()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, row := range tables {
|
for _, row := range tables {
|
||||||
@ -232,7 +237,7 @@ func (db *Db) GetSchema() ([]TableInfo, error) {
|
|||||||
ti.db = db
|
ti.db = db
|
||||||
fullti, err = ti.GetSchema()
|
fullti, err = ti.GetSchema()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
res = append(res, *fullti)
|
res = append(res, *fullti)
|
||||||
@ -285,18 +290,24 @@ func (db *Db) pgCreateTable(t TableInfo) error {
|
|||||||
}
|
}
|
||||||
query += columns
|
query += columns
|
||||||
query = query[:len(query)-1] + " )"
|
query = query[:len(query)-1] + " )"
|
||||||
|
if db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
_, err := t.db.conn.Query(query)
|
_, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for name, rowtype := range t.Columns {
|
for name, rowtype := range t.Columns {
|
||||||
desc := strings.Split(fmt.Sprintf("%v", rowtype), "|")
|
desc := strings.Split(fmt.Sprintf("%v", rowtype), "|")
|
||||||
if len(desc) > 1 {
|
if len(desc) > 1 {
|
||||||
query = "COMMENT ON COLUMN " + t.Name + "." + fmt.Sprintf("%v", name) + " IS '" + desc[1] + "'"
|
query = "COMMENT ON COLUMN " + t.Name + "." + fmt.Sprintf("%v", name) + " IS '" + desc[1] + "'"
|
||||||
|
if db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
_, err := t.db.conn.Query(query)
|
_, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,9 +334,12 @@ func (db *Db) myCreateTable(t TableInfo) error {
|
|||||||
}
|
}
|
||||||
query += columns
|
query += columns
|
||||||
query = query[:len(query)-1] + " )"
|
query = query[:len(query)-1] + " )"
|
||||||
|
if db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
_, err := t.db.conn.Query(query)
|
_, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -333,15 +347,21 @@ func (db *Db) myCreateTable(t TableInfo) error {
|
|||||||
|
|
||||||
func (t *TableInfo) DeleteTable() error {
|
func (t *TableInfo) DeleteTable() error {
|
||||||
query := "drop table " + t.Name
|
query := "drop table " + t.Name
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
_, err := t.db.conn.Query(query)
|
_, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
query = "drop sequence if exists sq_" + t.Name
|
query = "drop sequence if exists sq_" + t.Name
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
_, err = t.db.conn.Query(query)
|
_, err = t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -359,16 +379,22 @@ func (t *TableInfo) AddColumn(name string, sqltype string, comment string) error
|
|||||||
|
|
||||||
func (t *TableInfo) pgAddColumn(name string, sqltype string, comment string) error {
|
func (t *TableInfo) pgAddColumn(name string, sqltype string, comment string) error {
|
||||||
query := "alter table " + t.Name + " add " + name + " " + sqltype
|
query := "alter table " + t.Name + " add " + name + " " + sqltype
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
rows, err := t.db.conn.Query(query)
|
rows, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if strings.TrimSpace(comment) != "" {
|
if strings.TrimSpace(comment) != "" {
|
||||||
query = "COMMENT ON COLUMN " + t.Name + "." + name + " IS '" + comment + "'"
|
query = "COMMENT ON COLUMN " + t.Name + "." + name + " IS '" + comment + "'"
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
_, err = t.db.conn.Query(query)
|
_, err = t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,9 +407,12 @@ func (t *TableInfo) myAddColumn(name string, sqltype string, comment string) err
|
|||||||
if strings.TrimSpace(comment) != "" {
|
if strings.TrimSpace(comment) != "" {
|
||||||
query += " COMMENT " + pq.QuoteLiteral(comment)
|
query += " COMMENT " + pq.QuoteLiteral(comment)
|
||||||
}
|
}
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
rows, err := t.db.conn.Query(query)
|
rows, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
@ -392,9 +421,12 @@ func (t *TableInfo) myAddColumn(name string, sqltype string, comment string) err
|
|||||||
|
|
||||||
func (t *TableInfo) DeleteColumn(name string) error {
|
func (t *TableInfo) DeleteColumn(name string) error {
|
||||||
query := "alter table " + t.Name + " drop " + name
|
query := "alter table " + t.Name + " drop " + name
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
rows, err := t.db.conn.Query(query)
|
rows, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
@ -407,13 +439,13 @@ func (db *Db) ImportSchema(filename string) {
|
|||||||
var jsonSource []TableInfo
|
var jsonSource []TableInfo
|
||||||
err := json.Unmarshal([]byte(byteValue), &jsonSource)
|
err := json.Unmarshal([]byte(byteValue), &jsonSource)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
}
|
}
|
||||||
for _, ti := range jsonSource {
|
for _, ti := range jsonSource {
|
||||||
ti.db = db
|
ti.db = db
|
||||||
err = db.CreateTable(ti)
|
err = db.CreateTable(ti)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,7 +459,7 @@ func (db *Db) ClearImportSchema(filename string) {
|
|||||||
ti.db = db
|
ti.db = db
|
||||||
err := ti.DeleteTable()
|
err := ti.DeleteTable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,7 +490,7 @@ func (t *TableInfo) Insert(record AssRow) (int64, error) {
|
|||||||
values := ""
|
values := ""
|
||||||
t, err := t.GetSchema()
|
t, err := t.GetSchema()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
var id int64
|
var id int64
|
||||||
@ -468,7 +500,11 @@ func (t *TableInfo) Insert(record AssRow) (int64, error) {
|
|||||||
values += FormatForSQL(t.Columns[key], element) + ","
|
values += FormatForSQL(t.Columns[key], element) + ","
|
||||||
}
|
}
|
||||||
if t.db.Driver == "postgres" {
|
if t.db.Driver == "postgres" {
|
||||||
err = t.db.conn.QueryRow("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ") RETURNING id").Scan(&id)
|
query := "INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ") RETURNING id"
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
|
err = t.db.conn.QueryRow(query).Scan(&id)
|
||||||
}
|
}
|
||||||
if t.db.Driver == "mysql" {
|
if t.db.Driver == "mysql" {
|
||||||
/* _, err = t.db.conn.Query("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")")
|
/* _, err = t.db.conn.Query("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")")
|
||||||
@ -476,7 +512,12 @@ func (t *TableInfo) Insert(record AssRow) (int64, error) {
|
|||||||
return id, err
|
return id, err
|
||||||
}
|
}
|
||||||
err = t.db.conn.QueryRow("SELECT LAST_INSERT_ID()").Scan(&id)*/
|
err = t.db.conn.QueryRow("SELECT LAST_INSERT_ID()").Scan(&id)*/
|
||||||
stmt, err := t.db.conn.Prepare("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")")
|
|
||||||
|
query := "INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")"
|
||||||
|
stmt, err := t.db.conn.Prepare(query)
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
fmt.Println("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")")
|
fmt.Println("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return id, err
|
return id, err
|
||||||
@ -497,7 +538,7 @@ func (t *TableInfo) Update(record AssRow) error {
|
|||||||
|
|
||||||
t, err := t.GetSchema()
|
t, err := t.GetSchema()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
id := ""
|
id := ""
|
||||||
@ -514,10 +555,13 @@ func (t *TableInfo) Update(record AssRow) error {
|
|||||||
}
|
}
|
||||||
stack = removeLastChar(stack)
|
stack = removeLastChar(stack)
|
||||||
query := ("UPDATE " + t.Name + " SET " + stack + " WHERE id = " + id)
|
query := ("UPDATE " + t.Name + " SET " + stack + " WHERE id = " + id)
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
rows, err := t.db.conn.Query(query)
|
rows, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(query)
|
log.Error().Msg(query)
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
@ -536,10 +580,13 @@ func (t *TableInfo) Delete(record AssRow) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
query := ("DELETE FROM " + t.Name + " WHERE id = " + id)
|
query := ("DELETE FROM " + t.Name + " WHERE id = " + id)
|
||||||
|
if t.db.LogQueries {
|
||||||
|
log.Info().Msg(query)
|
||||||
|
}
|
||||||
rows, err := t.db.conn.Query(query)
|
rows, err := t.db.conn.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(query)
|
log.Error().Msg(query)
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
@ -593,7 +640,7 @@ func Quote(str string) string {
|
|||||||
func (db *Db) SaveSchema(generatedFilename string) error {
|
func (db *Db) SaveSchema(generatedFilename string) error {
|
||||||
schema, err := db.GetSchema()
|
schema, err := db.GetSchema()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// file, _ := json.Marshal(schema)
|
// file, _ := json.Marshal(schema)
|
||||||
@ -624,7 +671,7 @@ func buildLinks(schema []TableInfo) []Link {
|
|||||||
func (db *Db) GenerateSchemaTemplate(templateFilename string, generatedFilename string) error {
|
func (db *Db) GenerateSchemaTemplate(templateFilename string, generatedFilename string) error {
|
||||||
schema, err := db.GetSchema()
|
schema, err := db.GetSchema()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
links := buildLinks(schema)
|
links := buildLinks(schema)
|
||||||
@ -638,17 +685,17 @@ func (db *Db) GenerateSchemaTemplate(templateFilename string, generatedFilename
|
|||||||
|
|
||||||
t, err := template.ParseFiles(templateFilename)
|
t, err := template.ParseFiles(templateFilename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f, err := os.Create(generatedFilename)
|
f, err := os.Create(generatedFilename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("create file: ", err)
|
log.Error().Msg("create file: " + err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = t.Execute(f, data)
|
err = t.Execute(f, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -658,24 +705,24 @@ func (db *Db) GenerateSchemaTemplate(templateFilename string, generatedFilename
|
|||||||
func (db *Db) GenerateTableTemplates(templateFilename string, outputFolder string, extension string) error {
|
func (db *Db) GenerateTableTemplates(templateFilename string, outputFolder string, extension string) error {
|
||||||
schema, err := db.GetSchema()
|
schema, err := db.GetSchema()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, ti := range schema {
|
for _, ti := range schema {
|
||||||
|
|
||||||
t, err := template.ParseFiles(templateFilename)
|
t, err := template.ParseFiles(templateFilename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f, err := os.Create(outputFolder + string(os.PathSeparator) + ti.Name + "." + extension)
|
f, err := os.Create(outputFolder + string(os.PathSeparator) + ti.Name + "." + extension)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("create file: ", err)
|
log.Error().Msg("create file: " + err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = t.Execute(f, ti)
|
err = t.Execute(f, ti)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error().Msg(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
go.mod
10
go.mod
@ -3,13 +3,13 @@ module forge.redroom.link/yves/sqldb
|
|||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
github.com/lib/pq v1.10.4
|
github.com/lib/pq v1.10.4
|
||||||
gorm.io/driver/mysql v1.5.1
|
github.com/rs/zerolog v1.31.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-sql-driver/mysql v1.7.1 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||||
github.com/jinzhu/now v1.1.5 // indirect
|
golang.org/x/sys v0.12.0 // indirect
|
||||||
gorm.io/gorm v1.25.1 // indirect
|
|
||||||
)
|
)
|
||||||
|
24
go.sum
24
go.sum
@ -1,13 +1,19 @@
|
|||||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
||||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
|
||||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
|
||||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
|
||||||
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
|
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
|
||||||
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
gorm.io/gorm v1.25.1 h1:nsSALe5Pr+cM3V1qwwQ7rOkw+6UeLrX5O4v3llhHa64=
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
|
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||||
|
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||||
|
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
|
||||||
|
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
||||||
|
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
Loading…
Reference in New Issue
Block a user