qtable

package module
v0.0.0-...-51e0b9b Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 5 Imported by: 0

README

qtable

A simple Go package which converts the results of an SQL query to a textual table via table writer.

GoDoc

A query such as SELECT name FROM users could be presented as:

+------+
| NAME |
+------+
| bob  |
| cob  |
| dob  |
| hey  |
| job  |
| slob |
+------+

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(rows *sql.Rows, e error) (table []byte, err error)

Generate accepts rows and generates a table. It accepts an error as it's second parameter so it can be composed with sql.DB.Query It closes rows.

func GenerateCustom

func GenerateCustom(rows *sql.Rows, wr *tablewriter.Table) error

GenerateCustom accepts rows and an instantiated table writer wr hould not already have it's header set. It closes rows.

Types

This section is empty.

Jump to

Keyboard shortcuts

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