sqlite

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSchema

func FormatSchema(schema string) string

func ParseIndexDDL added in v0.2.4

func ParseIndexDDL(schemas string) []string

func ParseSchema

func ParseSchema(schema string) *internal.MySchema

ParseSchema parse table's schema

Types

type Compare

type Compare struct {
}

func NewCompare

func NewCompare() *Compare

func (*Compare) AlterData

func (c *Compare) AlterData(sc *internal.SchemaSync, table string) (*internal.TableAlterData, error)

type MyDb

type MyDb struct {
	*sql.DB
	// contains filtered or unexported fields
}

MyDb db struct

func New

func New(dsn string, dbType string) *MyDb

New parse dsn

func (*MyDb) DBEngine

func (mydb *MyDb) DBEngine() string

func (*MyDb) Exec

func (mydb *MyDb) Exec(query string) (sql.Result, error)

Exec execute sql query

func (*MyDb) GetTableNames

func (mydb *MyDb) GetTableNames() ([]string, error)

GetTableNames table names

func (*MyDb) GetTableSchema

func (mydb *MyDb) GetTableSchema(name string) (schema string, err error)

GetTableSchema table schema

func (*MyDb) Query

func (mydb *MyDb) Query(query string, args ...interface{}) (*sql.Rows, error)

Query execute sql query

type SchemaData

type SchemaData struct {
	Data string
	// contains filtered or unexported fields
}

SchemaData db schema data

func NewSchemaData

func NewSchemaData(schema string, dbType string) *SchemaData

NewSchemaData object

func (*SchemaData) Begin

func (m *SchemaData) Begin() (*sql.Tx, error)

func (*SchemaData) Close

func (m *SchemaData) Close() error

func (*SchemaData) DBEngine

func (m *SchemaData) DBEngine() string

func (*SchemaData) Exec

func (m *SchemaData) Exec(query string) (sql.Result, error)

Exec execute sql query

func (*SchemaData) GetTableNames

func (m *SchemaData) GetTableNames() ([]string, error)

GetTableNames table names

func (*SchemaData) GetTableSchema

func (m *SchemaData) GetTableSchema(name string) (schema string, err error)

GetTableSchema table schema

func (*SchemaData) Query

func (m *SchemaData) Query(query string, args ...interface{}) (*sql.Rows, error)

Query execute sql query

Jump to

Keyboard shortcuts

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