Categorygithub.com/ginger-go/sql
modulepackage
1.0.8
Repository: https://github.com/ginger-go/sql.git
Documentation: pkg.go.dev

# README

sql

Our SQL package for Golang, built on top of GORM, offers a powerful and intuitive solution for building SQL queries and performing database operations. With a focus on ease of use, we provide a set of generic type methods that can seamlessly interact with any database structure.

The centerpiece of our package is the clause builder, a highly flexible tool that allows you to construct complex SQL statements with a simple and chainable API. By abstracting away the underlying details, our package empowers users to create precise queries with ease.

Beyond the clause builder, we offer a suite of generic type methods for common database operations, such as querying, writing, updating, and deleting records. These methods can be used with any database model that follows the GORM convention, making integration with existing codebases a breeze.

Our SQL package for Golang aims to simplify the process of working with databases, minimizing the challenges and complexities often associated with database management. We invite you to try out our package and experience firsthand how it can enhance your Golang project.

Installation

go get -u github.com/ginger-go/sql

Documentation

Please refer to https://ginger-go.gitbook.io/sql/ for the full documentation.

Perform test

Run ginkgo tests with the following command:

ginkgo -r -v -p --cover --coverpkg=github.com/ginger-go/sql

Read the coverage report with the following command:

go tool cover -html=coverprofile.out

# Functions

And creates a new Clause with the operator "AND".
Count counts the number of records that match the given clause.
Delete deletes the given model.
DeleteAll deletes all the given models.
DeleteAllByClause deletes all the models that match the given clause.
Eq creates a new Clause with the operator "=".
FindAll finds all records that match the given clause.
FindAllComplex finds all records that match the given clause and applies the given sort and pagination.
FindOne finds one record that matches the given clause.
Gt creates a new Clause with the operator ">".
Gte creates a new Clause with the operator ">=".
In creates a new Clause with the operator "IN".
IsNotNull creates a new Clause with the operator "IS NOT NULL".
IsNull creates a new Clause with the operator "IS NULL".
Like creates a new Clause with the operator "LIKE".
Lt creates a new Clause with the operator "<".
Lte creates a new Clause with the operator "<=".
Neq creates a new Clause with the operator "<>".
NewClause creates a new Clause.
NotIn creates a new Clause with the operator "NOT IN".
NotLike creates a new Clause with the operator "NOT LIKE".
NotSimilar creates a new Clause with the operator "NOT LIKE" and the value "%value%".
Or creates a new Clause with the operator "OR".
No description provided by the author
No description provided by the author
Save saves the given model.
SaveAll saves all the given models.
Similar creates a new Clause with the operator "LIKE" and the value "%value%".

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

Clause is a struct that represents a clause in a SQL statement.
No description provided by the author
No description provided by the author
No description provided by the author