Code Monkey home page Code Monkey logo

query's Introduction

query

Go Reference

Query implements SQL query builder for Go. The aim is to provide fast and simple interface to database functions without need to write SQL code at all.

Main features:

  • supporting SELECT (and SELECT COUNT() as subset of SELECT), INSERT, UPDATE and DELETE queries;
  • supporting fields conditions to use in SELECT/UPDATE/DELETE queries;
  • supporting field and table names aliasing;
  • supporting tables JOIN's keeping Golang syntax as close to SQL as possible;
  • provides string types to wrap table and field names constants allows to keep all definitions in single place and avoid mistypings;
  • generated queries could use either '?' or '$N' placeholders depending on your needs;
  • supporting conditionals building over single or several joined tables using complex conditions
  • allows to extend standard conditions library with new condition implementations types when required
  • all query builders are immutable which allows to keep original complex query definitions and easily derive new ones

Alternatives and related projects

Here is open source alternatives on 09.09.2022:

  • sqlf - A fast SQL query builder for Go, last v1.3.0 fired 05.01.2022, switches versions ~ once per 3 month
  • dbr - provides additions to Go's database/sql for super fast performance and convenience. Last version v2.7.3 launched 24.12.2021, switches versions ~ once per 6 month.
  • Squirrel - simple and fluent SQL queries builder from composable parts. Last version v1.5.3 launched 20.05.2022. Development complete, bug fixes will still be merged (slowly). Bug reports are welcome, but I will not necessarily respond to them. If another fork (or substantially similar project) actively improves on what Squirrel does, let me know and I may link to it here.
  • SQLR - fat-free version of squirrel - fluent SQL generator for Go. Actually a merge of squirrel and dbr ideas. No published versions at all, last commit on 28.07.2021. Looks stale.
  • Gocu - An expressive SQL builder and executor. Last version v9.18.0 launched 17.10.2021, before this v9.18.0 about a version per 2 months.

Not really a builders but are the SQL helpers and ORM packages:

  • GORP - provides a simple way to marshal Go structs to and from SQL databases. It uses the database/sql package, and should work with any compliant database/sql driver
  • GORM - fantastic ORM library for Golang, aims to be developer friendly.

query's People

Contributors

amarin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.