dbutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanReadFromStandardInput

func CanReadFromStandardInput() bool

CanReadFromStandardInput returns whether there is data to be read in stdin.

func Dump

func Dump(ctx context.Context, db *genji.DB, w io.Writer, tables ...string) error

Dump takes a database and dumps its content as SQL queries in the given writer. If tables is provided, only selected tables will be outputted.

func DumpSchema

func DumpSchema(ctx context.Context, db *genji.DB, w io.Writer, tables ...string) error

DumpSchema takes a database and dumps its schema as SQL queries in the given writer. If tables are provided, only selected tables will be outputted.

func ExecSQL

func ExecSQL(ctx context.Context, db *genji.DB, r io.Reader, w io.Writer) error

ExecSQL reads SQL queries from reader and executes them until the reader is exhausted. If the query has results, they will be outputted to w.

func InsertJSON

func InsertJSON(db *genji.DB, table string, r io.Reader) error

InsertJSON reads json documents from r and inserts them into the selected table. The reader can be either a stream of json objects or an array of objects.

func OpenDB

func OpenDB(ctx context.Context, dbPath, engineName string) (*genji.DB, error)

OpenDB opens a database at the given path, using the selected engine.

Types

This section is empty.

Jump to

Keyboard shortcuts

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