Skip to content

MigOpsRepos/gotsql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GoTSQL - A Better Way to Organize SQL codebase using Templates in Golang

  1. Installation through Go Get command

    $ go get github.com/migopsrepos/gotsql
  2. Initialize the GoTSQL object

    import "github.com/migopsrepos/gotsql"
    ...
    g := gotsql.GoTSQL{}
  3. Load the template file or directory with template files. (Templates are discussed in detail in next section)

    g.Load("library/")
    ...
    g.Load("library_dev/")
  4. 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages