sql

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatColumnSelect

func FormatColumnSelect(columns []string, aliasAndDestination ...string) []string

FormatColumnSelect returns a list of column names to be used in a SQL Select modified with optional alias and destination.

aliasAndDestination supports two arguments, an alias followed by a destination. Any arguments after are ignored.

If an alias is provided, each column is prefixed with it. Otherwise the columns are returned as is.

If a destination is provided, each column will be assigned to it. Otherwise there is no adjustment.

Example - alias, no destination. Input: ([id, name], "w") Output: [w.id, w.name]

Example - with alias, destination Input: ([id, name], "w", "workflow") Output: [w.id "workflow.id", w.name "workflow.name"]

Types

This section is empty.

Jump to

Keyboard shortcuts

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