parse

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashtagDelimiter replaces #fragments in rewritten SQL before generation
	// splices fragment arguments back in.
	HashtagDelimiter = "__HASHTAG_DELIMITER__"
)

Variables

This section is empty.

Functions

func FindTableByAlias

func FindTableByAlias(schema model.Schema, alias string) (string, bool)

FindTableByAlias returns a schema table name or registered alias.

func QueryFile

func QueryFile(content string, schema model.Schema, d model.Dialect) (model.QueryFile, error)

QueryFile parses a queryc file into imports and named queries.

func QueryFilePath

func QueryFilePath(path string, schema model.Schema, d model.Dialect) (model.QueryFile, error)

QueryFilePath reads a queryc file or directory from disk and parses it.

func ReadFileOrDir

func ReadFileOrDir(path string) ([]byte, error)

ReadFileOrDir reads a file or directory recursively (only .sql files).

func Schema

func Schema(content string, d model.Dialect) (model.Schema, error)

Schema parses CREATE TABLE statements from content.

func SchemaFile

func SchemaFile(path string, d model.Dialect) (model.Schema, error)

SchemaFile reads and parses schema SQL from a file or directory.

func StripQueryCMarkers

func StripQueryCMarkers(sql string) string

StripQueryCMarkers removes internal sentinel comments used by the feature layer to flag JSON serialised columns.

func ToCamel

func ToCamel(s string) string

ToCamel converts snake_case identifiers to lower camel case.

func ToPascal

func ToPascal(s string) string

ToPascal converts snake_case identifiers to PascalCase.

func ToSingular

func ToSingular(s string) string

ToSingular applies common English plural to singular heuristics for type names.

Types

This section is empty.

Jump to

Keyboard shortcuts

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