lexer

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

The job of this package is to parse the queries and replace placeholder values with the real values

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(sql string, arg interface{}) (string, error)

Compile is used for parsing and compiling sql queries

func Finalize

func Finalize(parts *[]Part, args ...interface{}) (string, error)

Finalize is a function that finalizes the traditional sql queries before they are executed

func FinalizeNamed

func FinalizeNamed(parts *[]PartNamed, arg interface{}) (string, error)

FinalizeNamed is a function that finalizes the named sql queries before they are executed

func Format added in v0.3.0

func Format(q string) string

Format is just an internal algo to format sql queries It basically removes unneccessary whitespace from queries Automatically used by prepare CURRENTLY DOES NOT REMOVE COMMENTS

func Prepare

func Prepare(sql string) *[]Part

Prepare is used for parsing and preparing sql queries

func PrepareNamed

func PrepareNamed(sql string) (*[]PartNamed, error)

PrepareNamed is used for parsing and preparing sql queries

Types

type Part

type Part struct {
	Str     string
	OnParam bool
}

type PartNamed

type PartNamed struct {
	Str     string
	OnParam bool
}

Jump to

Keyboard shortcuts

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