textql

package module
v0.0.0-...-0f9b7a6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2015 License: MIT Imports: 16 Imported by: 1

README

TextQL

Allows you to easily execute SQL against structured text like CSV or TSV.

Example session: textql_usage_session

Key differences between textql and sqlite importing

  • sqlite import will not accept stdin, breaking unix pipes. textql will happily do so.
  • textql supports quote escaped delimiters, sqlite does not.

Is it any good?

Yes

Requirements

  • Go

Install

You may need to export CC=clang on OS X.

go get -u github.com/dinedal/textql

Usage

  -console=false: After all commands are run, open sqlite3 console with this data
  -dlm=",": Delimiter between fields -dlm=tab for tab, -dlm=0x## to specify a character code in hex
  -header=false: Treat file as having the first row as a header row
  -outputHeader=false: Display column names in output
  -save-to="": If set, sqlite3 db is left on disk at this path
  -source="stdin": Source file to load, or defaults to stdin
  -sql="": SQL Command(s) to run on the data
  -table-name="tbl": Override the default table name (tbl)
  -verbose=false: Enable verbose logging

License

New MIT License - Copyright (c) 2014, Paul Bergeron

See LICENSE for details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(db *sql.DB, commands *string, separator rune, verbose *bool, outputHeader *bool)

func Load

func Load(source_text *string, delimiter *string, lazyQuotes *bool,
	header *bool, tableName *string, save_to *string, console *bool,
	verbose *bool) (*sql.DB, *string, rune)

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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