crud

package
v0.0.0-...-d4a6c04 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(table string, columns []string, values []interface{}) (map[string]interface{}, error)

Create inserts a new record into the table and returns the created record

func Delete

func Delete(table string, id int64) error

Delete removes a record based on a table and ID

func List

func List(table string, filters map[string]interface{}) ([]map[string]interface{}, error)

List retrieves records based on a table and a map of key and values

func Raw

func Raw(query string, args ...interface{}) ([]map[string]interface{}, int64, error)

Raw executes any SQL command (SELECT, INSERT, UPDATE, DELETE, etc.)

func Read

func Read(table string, id int64) (map[string]interface{}, error)

Read retrieves a record from the table based on the ID

func Update

func Update(table string, id int64, updates map[string]interface{}) (map[string]interface{}, error)

Update updates a record based on a table and ID, and returns the updated record dynamically

Types

This section is empty.

Jump to

Keyboard shortcuts

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