index

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: BSD-3-Clause Imports: 9 Imported by: 1

README

go-whosonfirst-sqlite-index

Go package for creating SQLite databases.

Important

Documentation for this package is incomplete and will be updated shortly.

Tools

$> make cli
go build -mod vendor -o bin/example cmd/example/main.go
example
> ./bin/example -h
Usage of ./bin/example:
  -driver string
    	 (default "sqlite3")
  -dsn string
    	 (default ":memory:")
  -emitter-uri string
    	A valid whosonfirst/go-whosonfirst-iterate/emitter URI. Valid schemes are: directory://,featurecollection://,file://,filelist://,geojsonl://,repo://. (default "repo://")
  -live-hard-die-fast
    	Enable various performance-related pragmas at the expense of possible (unlikely) database corruption (default true)
  -post-index
    	Enable post indexing callback function
  -timings
    	Display timings during and after indexing

For example:

$> ./bin/example -dsn test.db /usr/local/data/sfomuseum-data-architecture/
2021/02/18 11:34:58 time to index paths (1) 403.514656ms

$> sqlite3  test.db 
SQLite version 3.28.0 2019-04-15 14:49:49
Enter ".help" for usage hints.
sqlite> .tables
example

sqlite> SELECT COUNT(id) FROM example;
12751

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteIndexer

type SQLiteIndexer struct {
	Timings bool
	Logger  *log.WOFLogger
	// contains filtered or unexported fields
}

func NewSQLiteIndexer

func NewSQLiteIndexer(opts *SQLiteIndexerOptions) (*SQLiteIndexer, error)

func (*SQLiteIndexer) IndexPaths

func (idx *SQLiteIndexer) IndexPaths(ctx context.Context, emitter_uri string, uris []string) error

type SQLiteIndexerLoadRecordFunc added in v0.2.0

type SQLiteIndexerLoadRecordFunc func(context.Context, io.ReadSeeker, ...interface{}) (interface{}, error)

type SQLiteIndexerOptions added in v0.2.0

type SQLiteIndexerOptions struct {
	DB             sqlite.Database
	Tables         []sqlite.Table
	LoadRecordFunc SQLiteIndexerLoadRecordFunc
	PostIndexFunc  SQLiteIndexerPostIndexFunc
}

type SQLiteIndexerPostIndexFunc added in v0.2.0

type SQLiteIndexerPostIndexFunc func(context.Context, sqlite.Database, []sqlite.Table, interface{}) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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