Goyesql Save

Go + Yesql

Project README

Go Go Report Card GoDoc

goyesql

Golang + Yesql

Parse a file and associate SQL queries to a map. Useful for separating SQL from code logic.

Installation

$ go get -u github.com/nleof/goyesql

Usage

Create a file containing your SQL queries

-- queries.sql

-- name: list
SELECT *
FROM foo;

-- name: get
SELECT *
FROM foo
WHERE bar = $1;

And just call them in your code!

queries := goyesql.MustParseFile("queries.sql")
// use queries["list"] with sql/database, sqlx ...

Enjoy!

Open Source Agenda is not affiliated with "Goyesql" Project. README Source: nleof/goyesql
Stars
248
Open Issues
1
Last Commit
5 months ago
Repository
License
Tags

Open Source Agenda Badge

Open Source Agenda Rating