package
module
Version:
v0.0.0-...-ed9a77b
Opens a new window with list of versions in this module.
Published: May 22, 2023
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
GoTSQL - A Better Way to Organize SQL codebase using Templates in Golang
-
Installation through Go Get command
$ go get github.com/migopsrepos/gotsql
-
Initialize the GoTSQL object
import "github.com/migopsrepos/gotsql"
...
g := gotsql.GoTSQL{}
-
Load the template file or directory with template files. (Templates are discussed in detail in next section)
g.Load("library/")
...
g.Load("library_dev/")
-
Get the query using namespace and use it in Golang
query, err := g.Get("library/books/crud/getAllBooks", nil)
...
rows, err := db.Query(query, ...)
You can find the usage and more examples in this article
Documentation
¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.