func load(r io.Reader, db *sieve.DB) {
	var decoder = json.NewDecoder(r)
	for {
		var row = &sieve.Row{}
		if err := decoder.Decode(&row.Data); err == io.EOF {
			break
		} else if err != nil {
			log.Println("err:", err)
			continue
		}
		db.Append(row)
	}
}
Parses a reader and streams it into the database.
package main
import (
	"encoding/json"
	"flag"
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"github.com/benbjohnson/sieve"
)
var (
	addr = flag.String("addr", ":6900", "HTTP address")
)
func usage() {
	fmt.Fprintln(os.Stderr, "usage: sieve [opts]")
	flag.PrintDefaults()
	os.Exit(2)
}
func main() {
	flag.Usage = usage
	flag.Parse()
	var db = sieve.NewDB()
	go load(os.Stdin, db)
	fmt.Printf("Listening on http://localhost%s\n", *addr)
	log.Fatal(http.ListenAndServe(*addr, sieve.NewHandler(db)))
}