flite

command module
v0.0.0-...-c836c2d Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: MIT Imports: 7 Imported by: 0

README

Go Reference Go Report Card codecov

flite

flite is a SQLite extension and command line utility for working with local data files. It's meant to work in tandem with built-in functionality such as the SQLite JSON1 extension.

Usage

SQLite Extension

flite can be compiled to a shared library and be loaded as a SQLite runtime extension. Run make and the shared library will available be at ./build/flite.so.

Command Line Interface

make will also produce a binary at ./build/flite.

lines

split is an eponoymous-only virtual table (table-valued-function) that reads a file from disk (or stdin if no file is specified) and splits it into rows by a delimiter (defaults to \n).

SELECT * FROM split("/path/to/some/file.ndjson")

file_read

file_read is a scalar function that returns the contents of a file (path provided as an argument). If no path is supplied, it reads from stdin.

SELECT file_read("/path/to/file.json")

yaml_to_json

yaml_to_json is a scalar function that expects a single argument (a YAML string) and returns it as a JSON string (which can be used in the built-in JSON methods)

SELECT yaml_to_json("hello: world")
-- {"hello":"world"}

json_to_yaml

json_to_yaml is a scalar function that expects a single argument (a JSON string) and returns it as a YAML string.

SELECT json_to_yaml('{"hello":"world"}')
-- hello: world

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
sqlite
Package sqlite provides a golang target that depends on sqlite's C amalgamation file.
Package sqlite provides a golang target that depends on sqlite's C amalgamation file.
pkg
ext

Jump to

Keyboard shortcuts

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