sqlfmt

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUERY    = "Query"
	QUERYROW = "QueryRow"
	EXEC     = "Exec"
)

sqlfmt retrieves all strings from "Query" and "QueryRow" and "Exec" functions in .go file

Variables

This section is empty.

Functions

func Format

func Format(src string, options *Options) (string, error)

Format formats src in 3 steps 1: tokenize src 2: parse tokens by SQL clause group 3: for each clause group (Reindenter), add indentation or new line in the correct position

func Process

func Process(filename string, src []byte, options *Options) ([]byte, error)

Process formats SQL statement in .go file

Types

type FormatError

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

FormatError is an error that occurred while sqlfmt.Process

func (*FormatError) Error

func (e *FormatError) Error() string

type Options

type Options struct {
	Distance int
}

Options for go-sqlfmt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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