MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / GetInputSource

Function GetInputSource

cmd/gosqlx/internal/cmdutil/input.go:215–229  ·  view source on GitHub ↗

GetInputSource determines the source of input and returns the content.

(arg string)

Source from the content-addressed store, hash-verified

213
214// GetInputSource determines the source of input and returns the content.
215func GetInputSource(arg string) (*InputResult, error) {
216 if arg == "-" {
217 content, err := ReadFromStdin()
218 if err != nil {
219 return nil, err
220 }
221 return &InputResult{
222 Type: InputTypeSQL,
223 Content: content,
224 Source: "stdin",
225 }, nil
226 }
227
228 return DetectAndReadInput(arg)
229}
230
231// WriteOutput writes content to the specified output destination.
232func WriteOutput(content []byte, outputFile string, writer io.Writer) error {

Callers 1

ReadInputWithFallbackFunction · 0.70

Calls 2

ReadFromStdinFunction · 0.70
DetectAndReadInputFunction · 0.70

Tested by

no test coverage detected