Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.93 KB

README.md

File metadata and controls

54 lines (35 loc) · 1.93 KB

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