preprocess

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

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