Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Numbered ¶
type Numbered string
Numbered represents a placeholder with a numbered format, such as "$1", which is often used in PostgreSQL and other SQL databases.
func (Numbered) Get ¶
Get returns a formatted numbered placeholder string for Numbered. The placeholder format is based on the provided prefix (e.g., "$") followed by the index. Parameters:
n: The index to be used in the placeholder format (e.g., "$1").
Returns:
A string representing the numbered placeholder (e.g., "$1").
type Placeholder ¶
type Placeholder interface {
Get(int) string // Returns the placeholder string for a given index.
Numbered() bool // Returns true if the placeholder format is numbered.
}
Placeholder defines the interface for generating SQL placeholders in queries. Implementations of this interface provide different styles of placeholders, such as simple placeholders or numbered placeholders.
Methods:
Get(int) string: Returns the placeholder string for the given index. Numbered() bool: Indicates if the placeholder uses a numbered format.
type UnNumbered ¶
type UnNumbered string
UnNumbered represents a placeholder with a simple format, such as "?" which is commonly used in SQL queries.
func (UnNumbered) Get ¶
func (d UnNumbered) Get(int) string
Get returns the placeholder string for UnNumbered. It always returns "?" regardless of the provided index. Parameters:
index: The index of the placeholder (ignored for UnNumbered).
Returns:
A string representing the placeholder, which is always "?".
func (UnNumbered) Numbered ¶
func (UnNumbered) Numbered() bool
Numbered returns false for UnNumbered, indicating it does not use a numbered format.