apptypes

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DTypeInt = iota
	DTypeReal
	DTypeText
	DTypeID
	DTypeEnum
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputedTable

type ComputedTable struct {
	Name          string
	Doc           string
	View          string
	SourcePair    bool
	CacheOnTables []string
	TableSpec     TableSpec
}

type LoadColumn

type LoadColumn struct {
	Column     string
	DType      uint
	Required   bool
	Check      string
	Enum       []int
	Conversion func(s string) (any, error)
}

type LoadSchema

type LoadSchema struct {
	TablesGTFS          []LoadTable
	TableSystemTracking TableSpec
	TableSystemMDB      TableSpec
	ViewsSystem         []View
}

type LoadTable

type LoadTable struct {
	File      string
	Doc       string
	TableSpec TableSpec
}

type MobsqlRuntime

type MobsqlRuntime struct {
	DB          *sqlx.DB
	Schema      LoadSchema
	SchemaExtra *SchemaExtra // Extra SQL schema configuration (views & computed tables config)
}

type RuntimeConfig

type RuntimeConfig struct {
	MobilityDBCatalogCSVURI string `yaml:"mdb_csv,omitempty" json:"mdb_csv,omitempty"`                 // URI (file:// or http://) of Mobility Database Catalog CSV URI (use load custom GTFS), default Mobility DB bit.ly
	SQLiteDBPath            string `yaml:"sqlite_db,omitempty" json:"sqlite_db,omitempty"`             // Filesystem path for the SQLite DB, if "" uses default of ~/.cache/mobsql/sqlite.db
	AllowFileURIs           bool   `yaml:"allow_file_uris,omitempty" json:"allow_file_uris,omitempty"` // Whether to allow loading CSV/GTFS sources from local filepaths (file:// URIs)
	LogInfo                 bool   `yaml:"log_info,omitempty" json:"log_info,omitempty"`               // Whether to enable info messages
	LogWarn                 bool   `yaml:"log_warn,omitempty" json:"log_warn,omitempty"`               // Whether to enable warning messages
	LogDebug                bool   `yaml:"log_debug,omitempty" json:"log_debug,omitempty"`             // Whether to enable debug messages

	SchemaExtra *SchemaExtra `yaml:"-" json:"-"` // Extra SQL schema configuration (views & computed tables config)
}

RuntimeConfig contains the configuration for the Mobsql application passed on each operation.

SourcesetFilter represents the filter that is used to match against Mobility Database catalog sources allowing specifying mdbid's, geography, globs, bounding box matches, and similar.

type SchemaExtra

type SchemaExtra struct {
	InitExec       string          // Arbitrary SQL to execute at initialization (can be used for pragmas etc.)
	TablesComputed []ComputedTable // Computed table specifications to create
	Views          []View          // SQL views to create
}

SchemaExtra represents extra arbitrary SQL views & computed tables that may build upon the source GTFS tables.

type SourcesetOpResult

type SourcesetOpResult struct {
	Operation string `json:"operation"` // Name of operation (compute/purge/load)
	Success   bool   `json:"success"`   // Whether the operation was successful
	Mdbids    []int  `json:"mdbids"`    // Array of mdbids matched / performed against
}

SourcesetOpResult represents the result of a Compute, Purge, or Load request exposing whether the operation was successful and the effected mdbids.

type TableSpec

type TableSpec struct {
	Table     string
	UniqueSet []string
	Columns   []LoadColumn
	Indexes   [][]string
	Optional  bool
}

type View

type View struct {
	Name               string
	SQLCreateStatement string
	Doc                string
}

Jump to

Keyboard shortcuts

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