Skip to content

Releases: huandu/go-sqlbuilder

New feature: Add a new flavor SQLServer

07 Sep 03:03
153aee0
Compare
Choose a tag to compare

Per request in #64, SQL builder can build query for SQL Server now.

New feature: Field mapper function

21 Feb 12:32
Compare
Choose a tag to compare

Per #59, new APIs around field mapper functions are added.

In many production environments, table column names are usually snake_case words, e.g. user_id, while we have to use CamelCase in struct types to make struct fields public and golint happy. It's a bit redundant to use the db tag in every struct field. If there is a certain rule to map field names to table column names, We can use field mapper function to make code simpler.

See field mapper function sample as a demo.

New Feature: New method `SQL` in all pre-defined builders

03 Feb 16:21
116009b
Compare
Choose a tag to compare

There is a method SQL(sql string) implemented by all statement builders like SelectBuilder. We can use this method to insert any arbitrary SQL fragment when building a SQL. It's quite useful to build SQL containing non-standard syntax supported by a OLTP or OLAP system.

See README.md for more details.

New feature: SQLite support

26 Dec 16:14
Compare
Choose a tag to compare

SQLite flavor is added. Try it and let me know your feedback.

New feature: new field option `omitempty(tag1,tag2,...)`

02 Nov 09:05
Compare
Choose a tag to compare

The omitempty field option is upgraded to a function which can omit a field for one or more tags.

See #50 for details.

New feature: Support `Union` and `UnionAll`

28 Jul 04:09
Compare
Choose a tag to compare

Per #47, new methods Union and UnionAll are added to support UNION [ALL | DISTINCT] operators.

`Struct#SelectFrom` and `Struct#SelectFromForTag` add table name as prefix to all columns

21 Nov 07:04
Compare
Choose a tag to compare

Per #40, table name should be added as prefix (like table.col) to column names to avoid column name conflict. It's useful when building a SELECT with JOIN.

Add new methods in `Struct` to support INSERT IGNORE INTO and REPLACE INTO

11 Nov 09:11
Compare
Choose a tag to compare

Per #39, add new methods in Struct, including InsertIgnoreInto, ReplaceInto, InsertIgnoreIntoForTag and ReplaceIntoForTag.

New methods to build more complex UPDATE and INSERT INTO

11 Nov 09:17
006618a
Compare
Choose a tag to compare

Per #32, add new method SetMore in UpdateBuilder to add more assignments to UPDATE.

Per #33, add new method InsertIgnoreInto in InsertBuilder to support INSERT IGNORE INTO.

New feature: interpolate `args` in the `sql`

24 Apr 09:20
c4e6aae
Compare
Choose a tag to compare

#23 This feature is inspired by the interpolation feature implemented by github.com/go-sql-driver/mysql. It's designed to work with some less functional drivers to bind params to a SQL on client side rather than server side.