constnames

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package constnames declares tables and columns whose names are constants rather than literals, which is how many libraries write them, for the test that Declarations resolves them.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Users is named entirely by constants, one of them a concatenation.
	Users = expr.Table{Schema: schemaName, Name: usersTable, Alias: "u"}
	// Email names its column by a constant.
	Email = expr.Col[string](Users, emailCol)
	// Sessions is named by a typed constant.
	Sessions = expr.Table{Name: string(sessionsTable), Alias: "s"}
	// SessionID is a literal, for contrast.
	SessionID = expr.Col[int64](Sessions, "id")
	// Dynamic has its table built by a function, which no reader of source can
	// resolve, so Declarations reports it rather than guessing.
	Dynamic = expr.Col[int64](table(), "id")
)
View Source
var (

	// FromVariable names its column by the variable.
	FromVariable = expr.Col[string](Users, columnName)
	// Built is a Table from a function call, not a literal.
	Built = table()

	// PartlyConstant has a constant Name and a variable Alias.
	PartlyConstant = expr.Table{Name: "partly", Alias: aliasVar}
	// NotAColumn calls a Col that is not sqlb's.
	NotAColumn = lookalike.Col[int64](Users, "x")
	// NotACol is a two-argument generic call by another name.
	NotACol = lookalike.Pair[int](1, 2)
	// Local is a two-argument generic call with no package at all.
	Local = pair[int](1, 2)
	// Plain is a two-argument call that is not generic.
	Plain = two(1, 2)
)

Shapes Declarations must skip or report, never misread.

View Source
var (
	// FieldCall indexes a field named Col.
	FieldCall = h.Col[0](1, 2)
	// NestedCall reaches a field named Col through a nested selector.
	NestedCall = h.inner.Col[0](1, 2)
)
View Source
var Declared = []expr.Table{noValueA, noValueB}

Declared lists the two, so the pair is used and stays a declaration the scanner must read past.

View Source
var Origin = point{0, 0}

Origin is a positional literal.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package lookalike has a function named Col with Col's signature, so the test can check that Declarations reads only sqlb's Col and not every Col.
Package lookalike has a function named Col with Col's signature, so the test can check that Declarations reads only sqlb's Col and not every Col.

Jump to

Keyboard shortcuts

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