Socket
Book a DemoInstallSign in
Socket

github.com/mstetson/sqldata

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/mstetson/sqldata

v0.0.0-20250709223715-cce794701d8e
Source
Go
Version published
Created
Source

Package sqldata was an experiment in connecting SQL queries with Go data structures.

This package is not an ORM, but meets a similar need. Its performance is competitive with using database/sql directly, at least if you use prepared statements. It provides conveniences for writing queries, passing arguments, and scanning results based on data structures.

This package is FROZEN and should probably not be used in new work. Everything here is functional, but after using this system in production for several years, I see too many warts. The template language is too specialized and too difficult to extend. The SQLer concept is not quite right.

On the other hand, I like using this package better than any other database access method I've used – in Go or otherwise. I just think it needs another iteration. I have much of the design of the next iteration done, but I haven't had time to finish implementing it yet. It will not be API-compatible with this package.

I do not intend to make any further changes to this package. When I have the replacement ready, I'll reference it here. If anyone besides me is using this, please contact me.

Installation

go get github.com/mstetson/sqldata

Usage

Usage is intended to be much like database/sql. See godoc for details.

GoDoc

Example

	type Person struct {
		ID    int64
		Name  string
		City  string
		State string
	}
	var Person p
	err := sqldata.QueryRow(db, `select {{.}} from Persons where ID={{$1}}`, &p, 5)
	if err != nil { panic(err) }

This software is released into the public domain. See LICENSE for details.

Thanks to SchoolsPLP, LLC for funding part of the work and allowing this code to be released freely.

FAQs

Package last updated on 09 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.