Documentation
¶
Index ¶
- func Abbr(s string, maxWidth int) string
- func CollectionToMap[T Namer](collection []T) map[string]T
- func Create(dsn database.DataSourceNamer) (database.Database, error)
- func CreateClientForType(t database.Type) (database.Database, error)
- func CreateNoSQLClient(modelType database.NoSQLModelType) (database.NoSQL, error)
- func CreateSQLClient(dialect database.SQLDialectType) (database.SQL, error)
- func FirstN(s string, n int) string
- func LastN(s string, n int) string
- type Database
- type Databases
- type Engine
- type Engines
- type Field
- type Fields
- type Function
- type Functions
- type Namer
- type Role
- type Roles
- type Server
- type Servers
- type Table
- type Tables
- type View
- type Views
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectionToMap ¶
func CreateNoSQLClient ¶
func CreateNoSQLClient(modelType database.NoSQLModelType) (database.NoSQL, error)
func CreateSQLClient ¶
func CreateSQLClient(dialect database.SQLDialectType) (database.SQL, error)
Types ¶
type Database ¶
type Database struct {
Name string
Description string
Engine *Engine
Tables []*Table
Views []*View
Procedures []*Function
Roles []*Role
Properties struct {
CharacterSet string
Collation string
Locale string
ConnectionLimit int
Owner string
DefaultStorageEngine string
DefaultSchema string
DefaultNamespace string
SecurityModel string
RecoveryModel, BackupStrategy string
}
}
type Engine ¶
type Engine struct {
Name string
BuiltinFunctions []*Function
Properties struct {
Version string
TransactionSupport []string
ConcurrencyControl string
RecoveryModel string
StorageModel string
IntegrityEnforcement string
ReplicationCapabilities []string
IndexingCapabilities []string
Caching []string
}
}
type Field ¶
type Field struct {
Name string
Description string
Properties struct {
PrimaryKey bool
Type string
Length *int
Precision *int
Scale *int
Default *string
AutoInc *string // Auto increment seed, nil if AutoIncrement false
Virtual bool
Generated *string
Unique bool
Index bool
Nullable bool
AllowedValues []string // name? for enum or set (MySQL)
Encrypted bool
Overrides struct {
CharacterSet string
Collation string
}
}
}
type Function ¶
type Role ¶
type Server ¶
type Server struct {
Name string
Engine *Engine
Databases Databases
MaxConnections int
Timeout int
SecurityModel string
}
func (*Server) DatabaseMap ¶
type Table ¶
type Table struct {
Name string
Description string
Engine *Engine
Fields []*Field
Properties struct {
PrimaryKeys []string
Indexes []struct {
Name string
Description string
Fields []string
Type string // B-tree, Hash, etc.
Unique bool
Clustered bool
Spatial bool
}
ForeignKeys []struct {
Name string
Field *Field
ToTable string
ToField string
OnUpdate string
OnDelete string
}
Partitioned bool
}
}
Click to show internal directories.
Click to hide internal directories.