unsafe

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column added in v0.3.8

type Column struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Column is used to inform the column order as well as column type

type Content

type Content []Item

Content is used as a container for Unsafe Items

type Item

type Item map[string]interface{}

Item is used as a container for sql rows with unknown values

type Result added in v0.3.8

type Result struct {
	Columns []Column      `json:"columns"`
	Content []interface{} `json:"content"`
}

Result is the container for all sql result info

type Unsafe

type Unsafe struct {
	Cx sql.ConnX
}

Unsafe sets up a sql connection interface for later unsafe queries

func (*Unsafe) UnsafeGet

func (u *Unsafe) UnsafeGet(query string, params ...interface{}) (Result, error)

UnsafeGet is used when expecting a single instance of output values where types are unknown

func (*Unsafe) UnsafeSelect

func (u *Unsafe) UnsafeSelect(query string, params ...interface{}) (Result, error)

UnsafeSelect is used when expecting multiple instances of output values where types are unknown

Jump to

Keyboard shortcuts

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