table

package
v0.0.0-...-86b9d59 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	// contains filtered or unexported fields
}

A Table holds column names and types used when generating SQL statements.

func New

func New(name string, features []geojson.Feature, keepcase bool, w io.Writer) (*Table, error)

New creates a Table that holds column names and types extracted from features. Generated SQL will be written to w.

func (*Table) CopyRows

func (tab *Table) CopyRows(features []geojson.Feature) error

CopyRows produces SQL to insert rows for each feature using COPY FROM.

func (*Table) CreateTable

func (tab *Table) CreateTable() error

CreateTable produces SQL CREATE TABLE with columns for each property in features, and a column for wkb_geometry.

func (*Table) InsertRows

func (tab *Table) InsertRows(features []geojson.Feature) error

InsertRows produces a SQL INSERT statements for each feature.

Jump to

Keyboard shortcuts

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