package
0.1.5
Repository: https://github.com/detectify/nvdtools.git
Documentation: pkg.go.dev

# README

sqlutil

Package sqlutil provides utilities for Go's database/sql for dealing with SQL queries and database records.

Supports the following features:

  • Mapping structs to sets of columns ([]string) and values ([]interface{})
  • Using structs to build queries with bindings for safe Exec and Query
  • Binding struct fields to query response records
  • Embedding SQL schema as Go code along with an InitSchema helper function

# Packages

b64schema converts a SQL schema file into base64 encoded strings as Go code.

# Functions

Assign returns an empty AssignmentList.
Cond returns an empty QueryConditioSet.
Delete creates and initializes a new DELETE statement.
Insert creates and initializes a new INSERT statement.
NewRecords creates and initializes new Records from slice of any struct.
NewRecordType creates and initializes a new RecordType.
Replace creates and initializes a new REPLACE statement.
Select creates and initializes a new SELECT statement.
Update creates and initializes a new UPDATE statement.

# Structs

AssignmentList represents a list of assignments for the UPDATE command.
DeleteStmt represents a DELETE statement.
InsertStmt represents the INSERT statement.
NullTime represents a time.Time that may be null.
QueryConditionSet represents a set of database query conditions.
RecordType implements the Record interface for any struct with 'sql' tags as T.
SelectStmt represents a SELECT statement.
UpdateStmt represents the UPDATE statement.

# Interfaces

Record represents a database record.

# Type aliases

Records implements the Record interface for a slice of Records.