preprocess

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package preprocess is a SQL query preprocessor. It extracts a mapping of table references, converting illegal table names to legal SQL in the process.

As an example the statemnent: SELECT * FROM illegal_sql/name

will be converted to: SELECT * FROM illegal_sql_name as ds and return a map keying "illegal_name": "illegal/name"

preprocess exists to cover the ways in which Qri deviates from the SQL spec, while reducing the burdern of maintaining a complete parser. This process intentionally avoids creating any AST. Think if it as glorified regex

Index

Constants

View Source
const (
	// IllegalTok is the default for unrecognized tokens
	IllegalTok tokenType = iota
)

Variables

This section is empty.

Functions

func Query

func Query(query string) (string, map[string]string, error)

Query pulls dataset references from an SQL query, replacing dataset ref strings with legal SQL table names, and a mapping between the two

Types

This section is empty.

Jump to

Keyboard shortcuts

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