New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/rangelreale/sqldimel

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/rangelreale/sqldimel

  • v1.1.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

sqldimel

SQLDimel is an SQL DML query builder for Golang.

It just generates the INSERT, UPDATE and DELETE queries to be passed to the underlining database.

Using a processor, it is possible to customize the way parameters are generated on the SQL (with ?, $1, etc).

Processors using "?" and "$1, $2" are included.

NOTE: when using WHERE, ALWAYS use "?", this is the default placeholder that will be replaced by the processor.

INSTALLATION

go get github.com/RangelReale/sqldimel

import "github.com/RangelReale/sqldimel"

USAGE

b := sqldimel.NewBuilder("user")
b.Add("id", 1).
	Add("name", "Monte Marto").
	Add("dob", time.Now()).
	Add("optional", nil).
	Add("weight", 80.2).
	Where("id = ? and weight > ?", 1, 70.2)

// db = *sql.DB
res, err = b.Exec(db, sqldimel.UPDATE)
// or
// res, err = db.Exec(b.Output(sqldimel.UPDATE), b.OutputParams(sqldimel.UPDATE))

FAQs

Package last updated on 29 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc