Skip to content

Releases: xgfone/go-sqlx

v0.14.0

21 Feb 13:42
Compare
Choose a tag to compare
  • Added:
    • The type Time supports to customize the format when marshal it to string to json.
    • The Struct functions of the INSERT and SELECT statement support the anonymous field, such as
      type Anonym struct {
          Field1 string
          Field2 int
      }
      
      type Data struct {
          Anonym
      
          Field3 string
          Field4 string
      }
  • Changed:
    • Remove the function Table and use Table as the struct type to represent a db table.

v0.13.0

12 Feb 07:46
Compare
Choose a tag to compare
  • New:
    • Add the config Config of DB and some options.

v0.12.0

16 Sep 14:48
Compare
Choose a tag to compare
  • Added:
    • Add the type Column as the column of the SQL table.
    • Add the convenient methods BindRowXxx for the type SelectBuilder.
  • Changed:
    • SelectStruct no longer supports the tag table.
    • Add the new method Clone for the interface Valuer.
    • Change the parameter Order of the method OrderBy from optional to required.
    • Rename the functions Incr to Inc, Decr to Dec, and Column to ColumnCond.

v0.11.2

09 Sep 14:56
Compare
Choose a tag to compare
  • Fixed:
    • Use % to enclose the value of LIKE if it does not contain %.
  • Others:
    • Use Github Actions instead of travis.

v0.11.1

05 Jan 14:04
Compare
Choose a tag to compare
  • Fixed:
    • SELECT column supports the union of the function and table name, that's COUNT(TABLE_NAME.id) in SELECT COUNT(TABLE_NAME.id) FROM TABLE_NAME.

v0.11.0

01 Jan 09:36
Compare
Choose a tag to compare
  • Added:
    • Add the support of the JOIN statement for DELETE statement.
    • Add the support of the FROM and JOIN statements for UPDATE statement.
    • Add the methods ExecContext, QueryContext and QueryRowContext for DB to resolve ambiguity about Executor methods.
  • Changed:
    • SELECT JOIN uses the new syntax JoinOn.
    • UpdateBuilder.Table() supports the table alias.
    • Delete() supports the tables argument to set the deleted tables.
    • SelectStruct() supports the table name as the second optional argument.

v0.10.0

09 Sep 13:14
Compare
Choose a tag to compare
  • Added:
    • Add the alias Set of Assign.
    • Add the new type Bool to scan the sql BOOLEAN value.
    • Add the new type NamedArgs to support a set of NamedArgs.
    • Add the new method BindRows and BindRowsContext for SelectBuilder to scan the rows into the slice.
    • Add the new method WhereNamedArgs to support the interface NamedArg for the Where statement.
    • Add the new method SetNameArg and SetMoreNamedArg for UpdateBuilder to support the interface NamedArg.
    • Add the ASC and DESC short for OrderBy of SelectBuilder, like OrderByDesc and OrderByAsc.
    • Add some short aliases of ConditionSet, like Eq, NotEq, Gt, GtEq, Le, LeEq, etc.
  • Changed:
    • Rename the type Setters to SetterSet.
    • Rename the type Conditions to ConditionSet.
    • Add the table argument for Update() and NewUpdateBuilder().
    • Add the new method NamedArg() sql.NamedArg for the interface NamedArg.

v0.9.0

27 Aug 15:43
Compare
Choose a tag to compare
  • Added:
    • Add the type Time to scan the sql DATETIME/TIMESTAMP type.
  • Changed:
    • Change the interface Value to Valuer.
    • Remove the interface Scanner and merge it into the interface Valuer.

v0.8.0

26 Aug 13:38
Compare
Choose a tag to compare
  • Added:
    • Add the functions like XXXValuerWithDefault and XXXScannerWithDefault to create Scanner or Valuer with a default value.
  • Changed:
    • Change the interface Value to Valuer.
    • Add the interface fmt.Stringer into the interfaces Scanner and Valuer.

v0.7.0

21 Aug 14:28
Compare
Choose a tag to compare
  • Added:
    • Add the interceptor LogInterceptor to log the sql statement.
    • The default implementations of Scanner and Value support json.Marshaler and json.Unmarshaler.