Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Xun

type Xun struct {
	Manager *capsule.Manager `json:"-"`
	Name    string           `json:"name,omitempty"`
	Driver  string           `json:"type"`
	Version string           `json:"version,omitempty"`
	Options XunOptions       `json:"options"`
	types.MetaInfo
	types.ConnectorMetadata
	// contains filtered or unexported fields
}

Xun the xun database ORM

func (*Xun) Close added in v1.0.0

func (x *Xun) Close() error

Close connections

func (*Xun) GetMetaInfo added in v1.0.0

func (x *Xun) GetMetaInfo() types.MetaInfo

GetMetaInfo returns the meta information

func (*Xun) ID

func (x *Xun) ID() string

ID get connector id

func (*Xun) Is

func (x *Xun) Is(typ int) bool

Is the connections from dsl

func (*Xun) Query added in v1.0.0

func (x *Xun) Query() (query.Query, error)

Query get connector query interface

func (*Xun) Register

func (x *Xun) Register(file string, id string, dsl []byte) error

Register the connections from dsl

func (*Xun) Schema added in v1.0.0

func (x *Xun) Schema() (schema.Schema, error)

Schema get connector schema interface

func (*Xun) Setting added in v1.0.0

func (x *Xun) Setting() map[string]interface{}

Setting get the connection setting

type XunHost

type XunHost struct {
	File    string `json:"file,omitempty"`
	Host    string `json:"host,omitempty"`
	Port    string `json:"port,omitempty"`
	User    string `json:"user,omitempty"`
	Pass    string `json:"pass,omitempty"`
	Primary bool   `json:"primary,omitempty"`
	// contains filtered or unexported fields
}

XunHost the connection host

type XunOptions

type XunOptions struct {
	DB          string    `json:"db"`
	TablePrefix string    `json:"prefix"`
	Collation   string    `json:"collation,omitempty"`
	Charset     string    `json:"charset,omitempty"`
	ParseTime   bool      `json:"parseTime,omitempty"`
	Timeout     int       `json:"timeout,omitempty"`
	File        string    `json:"file,omitempty"`
	Hosts       []XunHost `json:"hosts"`
}

XunOptions the connetion options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL