sql

package module
v0.0.0-...-4ce546e Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: BSD-3-Clause Imports: 18 Imported by: 1

README

go-whosonfirst-spelunker-sql

Go package implementing the whosonfirst/go-whosonfirst-spelunker.Spelunker interface for use with database/sql backed databases.

Documentation

Documentation is incompete at this time. For starters consult the (also incomplete) documentation in the whosonfirst/go-whosonfirst-spelunker package.

Important

This is work in progress and you should expect things to change, break or simply not work yet.

Indexing

For example:

$> cd /usr/local/whosonfirst/go-whosonfirst-sqlite-features-index 
$> ./bin/wof-sqlite-index-features-mattn \
	-timings \
	-database-uri mattn:///usr/local/data/ca-search.db \
	-spelunker-tables \
	-index-alt geojson \
	/usr/local/data/whosonfirst-data-admin-ca

$> du -h /usr/local/data/ca-search.db
1.4G	/usr/local/data/ca-search.db

Tools

server

For example:

$> go run -mod readonly -tags "icu json1 fts5" cmd/httpd/main.go \
		-server-uri http://localhost:8080 \
		-spelunker-uri sql://sqlite3?dsn=file:/usr/local/data/ca-search.db
2024/02/13 08:46:41 INFO Listening for requests address=http://localhost:8080

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSQLSpelunker

func NewSQLSpelunker(ctx context.Context, uri string) (spelunker.Spelunker, error)

Types

type SQLSpelunker

type SQLSpelunker struct {
	spelunker.Spelunker
	// contains filtered or unexported fields
}

func (*SQLSpelunker) CountDescendants

func (s *SQLSpelunker) CountDescendants(ctx context.Context, id int64) (int64, error)

func (*SQLSpelunker) GetConcordances

func (s *SQLSpelunker) GetConcordances(ctx context.Context) (*spelunker.Faceting, error)

func (*SQLSpelunker) GetDescendants

func (s *SQLSpelunker) GetDescendants(ctx context.Context, pg_opts pagination.Options, id int64, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) GetDescendantsFaceted

func (s *SQLSpelunker) GetDescendantsFaceted(ctx context.Context, id int64, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

func (*SQLSpelunker) GetFeatureForId

func (s *SQLSpelunker) GetFeatureForId(ctx context.Context, id int64, uri_args *uri.URIArgs) ([]byte, error)

func (*SQLSpelunker) GetPlacetypes

func (s *SQLSpelunker) GetPlacetypes(ctx context.Context) (*spelunker.Faceting, error)

func (*SQLSpelunker) GetRecent

func (s *SQLSpelunker) GetRecent(ctx context.Context, pg_opts pagination.Options, d time.Duration, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) GetRecentFaceted

func (s *SQLSpelunker) GetRecentFaceted(ctx context.Context, d time.Duration, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

func (*SQLSpelunker) GetRecordForId

func (s *SQLSpelunker) GetRecordForId(ctx context.Context, id int64, uri_args *uri.URIArgs) ([]byte, error)

func (*SQLSpelunker) GetSPRForId

func (s *SQLSpelunker) GetSPRForId(ctx context.Context, id int64, uri_args *uri.URIArgs) (wof_spr.StandardPlacesResult, error)

func (*SQLSpelunker) GetTags

func (s *SQLSpelunker) GetTags(ctx context.Context) (*spelunker.Faceting, error)

func (*SQLSpelunker) HasConcordance

func (s *SQLSpelunker) HasConcordance(ctx context.Context, pg_opts pagination.Options, namespace string, predicate string, value any, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) HasConcordanceFaceted

func (s *SQLSpelunker) HasConcordanceFaceted(ctx context.Context, namespace string, predicate string, value any, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

func (*SQLSpelunker) HasPlacetype

func (s *SQLSpelunker) HasPlacetype(ctx context.Context, pg_opts pagination.Options, pt *placetypes.WOFPlacetype, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) HasPlacetypeFaceted

func (s *SQLSpelunker) HasPlacetypeFaceted(ctx context.Context, pt *placetypes.WOFPlacetype, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

func (*SQLSpelunker) HasTag

func (s *SQLSpelunker) HasTag(ctx context.Context, pg_opts pagination.Options, tag string, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) HasTagFaceted

func (s *SQLSpelunker) HasTagFaceted(ctx context.Context, tag string, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

func (*SQLSpelunker) Search

func (s *SQLSpelunker) Search(ctx context.Context, pg_opts pagination.Options, search_opts *spelunker.SearchOptions, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) SearchFaceted

func (s *SQLSpelunker) SearchFaceted(ctx context.Context, search_opts *spelunker.SearchOptions, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

func (*SQLSpelunker) VisitingNullIsland

func (s *SQLSpelunker) VisitingNullIsland(ctx context.Context, pg_opts pagination.Options, filters []spelunker.Filter) (wof_spr.StandardPlacesResults, pagination.Results, error)

func (*SQLSpelunker) VisitingNullIslandFaceted

func (s *SQLSpelunker) VisitingNullIslandFaceted(ctx context.Context, filters []spelunker.Filter, facets []*spelunker.Facet) ([]*spelunker.Faceting, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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