You've already forked openaccounting-server
forked from cybercinch/openaccounting-server
deps: update dependencies for GORM, Viper, and SQLite support
- Add GORM v1.25.12 with MySQL and SQLite drivers - Add Viper v1.19.0 for configuration management - Add UUID package for GORM model IDs - Update vendor directory with new dependencies - Update Go module requirements and checksums 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
107
vendor/gorm.io/gorm/migrator/column_type.go
generated
vendored
Normal file
107
vendor/gorm.io/gorm/migrator/column_type.go
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
package migrator
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// ColumnType column type implements ColumnType interface
|
||||
type ColumnType struct {
|
||||
SQLColumnType *sql.ColumnType
|
||||
NameValue sql.NullString
|
||||
DataTypeValue sql.NullString
|
||||
ColumnTypeValue sql.NullString
|
||||
PrimaryKeyValue sql.NullBool
|
||||
UniqueValue sql.NullBool
|
||||
AutoIncrementValue sql.NullBool
|
||||
LengthValue sql.NullInt64
|
||||
DecimalSizeValue sql.NullInt64
|
||||
ScaleValue sql.NullInt64
|
||||
NullableValue sql.NullBool
|
||||
ScanTypeValue reflect.Type
|
||||
CommentValue sql.NullString
|
||||
DefaultValueValue sql.NullString
|
||||
}
|
||||
|
||||
// Name returns the name or alias of the column.
|
||||
func (ct ColumnType) Name() string {
|
||||
if ct.NameValue.Valid {
|
||||
return ct.NameValue.String
|
||||
}
|
||||
return ct.SQLColumnType.Name()
|
||||
}
|
||||
|
||||
// DatabaseTypeName returns the database system name of the column type. If an empty
|
||||
// string is returned, then the driver type name is not supported.
|
||||
// Consult your driver documentation for a list of driver data types. Length specifiers
|
||||
// are not included.
|
||||
// Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL",
|
||||
// "INT", and "BIGINT".
|
||||
func (ct ColumnType) DatabaseTypeName() string {
|
||||
if ct.DataTypeValue.Valid {
|
||||
return ct.DataTypeValue.String
|
||||
}
|
||||
return ct.SQLColumnType.DatabaseTypeName()
|
||||
}
|
||||
|
||||
// ColumnType returns the database type of the column. like `varchar(16)`
|
||||
func (ct ColumnType) ColumnType() (columnType string, ok bool) {
|
||||
return ct.ColumnTypeValue.String, ct.ColumnTypeValue.Valid
|
||||
}
|
||||
|
||||
// PrimaryKey returns the column is primary key or not.
|
||||
func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) {
|
||||
return ct.PrimaryKeyValue.Bool, ct.PrimaryKeyValue.Valid
|
||||
}
|
||||
|
||||
// AutoIncrement returns the column is auto increment or not.
|
||||
func (ct ColumnType) AutoIncrement() (isAutoIncrement bool, ok bool) {
|
||||
return ct.AutoIncrementValue.Bool, ct.AutoIncrementValue.Valid
|
||||
}
|
||||
|
||||
// Length returns the column type length for variable length column types
|
||||
func (ct ColumnType) Length() (length int64, ok bool) {
|
||||
if ct.LengthValue.Valid {
|
||||
return ct.LengthValue.Int64, true
|
||||
}
|
||||
return ct.SQLColumnType.Length()
|
||||
}
|
||||
|
||||
// DecimalSize returns the scale and precision of a decimal type.
|
||||
func (ct ColumnType) DecimalSize() (precision int64, scale int64, ok bool) {
|
||||
if ct.DecimalSizeValue.Valid {
|
||||
return ct.DecimalSizeValue.Int64, ct.ScaleValue.Int64, true
|
||||
}
|
||||
return ct.SQLColumnType.DecimalSize()
|
||||
}
|
||||
|
||||
// Nullable reports whether the column may be null.
|
||||
func (ct ColumnType) Nullable() (nullable bool, ok bool) {
|
||||
if ct.NullableValue.Valid {
|
||||
return ct.NullableValue.Bool, true
|
||||
}
|
||||
return ct.SQLColumnType.Nullable()
|
||||
}
|
||||
|
||||
// Unique reports whether the column may be unique.
|
||||
func (ct ColumnType) Unique() (unique bool, ok bool) {
|
||||
return ct.UniqueValue.Bool, ct.UniqueValue.Valid
|
||||
}
|
||||
|
||||
// ScanType returns a Go type suitable for scanning into using Rows.Scan.
|
||||
func (ct ColumnType) ScanType() reflect.Type {
|
||||
if ct.ScanTypeValue != nil {
|
||||
return ct.ScanTypeValue
|
||||
}
|
||||
return ct.SQLColumnType.ScanType()
|
||||
}
|
||||
|
||||
// Comment returns the comment of current column.
|
||||
func (ct ColumnType) Comment() (value string, ok bool) {
|
||||
return ct.CommentValue.String, ct.CommentValue.Valid
|
||||
}
|
||||
|
||||
// DefaultValue returns the default value of current column.
|
||||
func (ct ColumnType) DefaultValue() (value string, ok bool) {
|
||||
return ct.DefaultValueValue.String, ct.DefaultValueValue.Valid
|
||||
}
|
||||
43
vendor/gorm.io/gorm/migrator/index.go
generated
vendored
Normal file
43
vendor/gorm.io/gorm/migrator/index.go
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
package migrator
|
||||
|
||||
import "database/sql"
|
||||
|
||||
// Index implements gorm.Index interface
|
||||
type Index struct {
|
||||
TableName string
|
||||
NameValue string
|
||||
ColumnList []string
|
||||
PrimaryKeyValue sql.NullBool
|
||||
UniqueValue sql.NullBool
|
||||
OptionValue string
|
||||
}
|
||||
|
||||
// Table return the table name of the index.
|
||||
func (idx Index) Table() string {
|
||||
return idx.TableName
|
||||
}
|
||||
|
||||
// Name return the name of the index.
|
||||
func (idx Index) Name() string {
|
||||
return idx.NameValue
|
||||
}
|
||||
|
||||
// Columns return the columns of the index
|
||||
func (idx Index) Columns() []string {
|
||||
return idx.ColumnList
|
||||
}
|
||||
|
||||
// PrimaryKey returns the index is primary key or not.
|
||||
func (idx Index) PrimaryKey() (isPrimaryKey bool, ok bool) {
|
||||
return idx.PrimaryKeyValue.Bool, idx.PrimaryKeyValue.Valid
|
||||
}
|
||||
|
||||
// Unique returns whether the index is unique or not.
|
||||
func (idx Index) Unique() (unique bool, ok bool) {
|
||||
return idx.UniqueValue.Bool, idx.UniqueValue.Valid
|
||||
}
|
||||
|
||||
// Option return the optional attribute of the index
|
||||
func (idx Index) Option() string {
|
||||
return idx.OptionValue
|
||||
}
|
||||
1024
vendor/gorm.io/gorm/migrator/migrator.go
generated
vendored
Normal file
1024
vendor/gorm.io/gorm/migrator/migrator.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
33
vendor/gorm.io/gorm/migrator/table_type.go
generated
vendored
Normal file
33
vendor/gorm.io/gorm/migrator/table_type.go
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
package migrator
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
// TableType table type implements TableType interface
|
||||
type TableType struct {
|
||||
SchemaValue string
|
||||
NameValue string
|
||||
TypeValue string
|
||||
CommentValue sql.NullString
|
||||
}
|
||||
|
||||
// Schema returns the schema of the table.
|
||||
func (ct TableType) Schema() string {
|
||||
return ct.SchemaValue
|
||||
}
|
||||
|
||||
// Name returns the name of the table.
|
||||
func (ct TableType) Name() string {
|
||||
return ct.NameValue
|
||||
}
|
||||
|
||||
// Type returns the type of the table.
|
||||
func (ct TableType) Type() string {
|
||||
return ct.TypeValue
|
||||
}
|
||||
|
||||
// Comment returns the comment of current table.
|
||||
func (ct TableType) Comment() (comment string, ok bool) {
|
||||
return ct.CommentValue.String, ct.CommentValue.Valid
|
||||
}
|
||||
Reference in New Issue
Block a user