regexes

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package regexes exposes pre compiled regular expressions that are used by ngorm.

Index

Constants

This section is empty.

Variables

View Source
var (
	//DistinctSQL matches distinct sql query
	DistinctSQL = regexp.MustCompile(`(?i)distinct[^a-z]+[a-z]+`)

	//Column matches database column
	// only match string like `name`, `users.name`
	Column = regexp.MustCompile("^[a-zA-Z]+(\\.[a-zA-Z]+)*$")

	//IsNumber matches if the string is a number.
	IsNumber = regexp.MustCompile("^\\s*\\d+\\s*$")

	//Comparison matches comparison in sql query
	Comparison = regexp.MustCompile("(?i) (=|<>|>|<|LIKE|IS|IN) ")

	//CountingQuery matches count query.
	CountingQuery = regexp.MustCompile("(?i)^count(.+)$")

	//KeyName matches _ in a string
	KeyName = regexp.MustCompile("(_*[^a-zA-Z]+_*|_+)")
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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