Documentation
¶
Overview ¶
Package xlsx4db provides dump and restore features by using Excel (XLSX) format.
Index ¶
- func BuildInsertQuery(db *sql.DB, table string, columns []string) (string, error)
- func BuildUpsertQuery(db *sql.DB, table string, columns []string) (string, error)
- func Dump(xf *xlsx.File, db *sql.DB, tables ...string) error
- func DumpContext(ctx context.Context, xf *xlsx.File, db *sql.DB, tables ...string) error
- func FetchTables(db *sql.DB) ([]string, error)
- func FetchTablesContext(ctx context.Context, db *sql.DB) ([]string, error)
- func Restore(db *sql.DB, xf *xlsx.File, refresh bool, tables ...string) error
- func RestoreContext(ctx context.Context, db *sql.DB, xf *xlsx.File, refresh bool, tables ...string) error
- func Update(db *sql.DB, xf *xlsx.File, tables ...string) error
- func UpdateContext(ctx context.Context, db *sql.DB, xf *xlsx.File, tables ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildInsertQuery ¶
BuildInsertQuery builds na insert statement with given columns.
func BuildUpsertQuery ¶
BuildUpsertQuery builds "insert or update" statement with given params.
func DumpContext ¶ added in v0.0.6
DumpContext dumps tables to XLSX file with context.Context.
func FetchTables ¶
FetchTables fetches all accessible tables from database.
func FetchTablesContext ¶ added in v0.0.6
FetchTablesContext fetches all accessible tables from database with context.Context.
func RestoreContext ¶ added in v0.0.6
func RestoreContext(ctx context.Context, db *sql.DB, xf *xlsx.File, refresh bool, tables ...string) error
RestoreContext restores tables from XLSX file with context.Context.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
xlsx4db
command
|
|
|
examples
|
|
|
check_mysql
command
|
|
|
check_psql
command
|
|
|
ct
command
|
|
|
users
command
|
|
|
xlsx_check
command
|
|
|
xlsx_dump
command
|
|
|
xlsx_restore
command
|