goquery

package module
v0.0.0-...-5d13646 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 7 Imported by: 1

README

Vardius - goquery

Build Status Coverage Status

GO Query Builder

ABOUT

Contributors:

Want to contribute ? Feel free to send pull requests!

Have problems, bugs, feature ideas? We are using the github issue tracker to manage them.

HOW TO USE

I didn't want to use an ORM library due to simple fact, I think it's an overextending of an already existing functionality. Anyway I wanted to be able to build query using database/sql in a nice, easy way. So I wrote this simple query builder that allows you to build and run your query.

For examples please check examples directory

License

This package is released under the MIT license. See the complete license in the package:

LICENSE

Documentation

Index

Constants

This section is empty.

Variables

View Source
var New factory

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Select(columns ...string) Builder
	Count(column string) Builder
	Save(entities interface{}) Builder
	Delete() Builder
	Distinct(bool) Builder
	From(from string) Builder
	Where(where string) Builder
	AndWhere(where string) Builder
	OrWhere(where string) Builder
	Having(having string) Builder
	AndHaving(having string) Builder
	OrHaving(having string) Builder
	OrderBy(column, order string) Builder
	AddOrderBy(column, order string) Builder
	GroupBy(columns ...string) Builder
	AddGroupBy(columns ...string) Builder
	Limit(i int64) Builder
	Offset(i int64) Builder
	SetParameters(parameters ...interface{}) Builder
	AddParameters(parameters ...interface{}) Builder
	Reset() Builder
	GetQuery() Query
}

type Query

type Query interface {
	GetResults(*sql.DB) (interface{}, error)
	GetResult(*sql.DB) (interface{}, error)
	GetCount(*sql.DB) (int64, error)
	Execute(*sql.DB) (interface{}, error)
	GetSQL() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL