update go version to v1.17 in .drone.yml (#2219)
issue: #2218 Co-authored-by: datbeohbbh <phongtomfapp@gmail.com> Reviewed-on: https://gitea.com/xorm/xorm/pulls/2219 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: datbeohbbh <datbeohbbh@noreply.gitea.io> Co-committed-by: datbeohbbh <datbeohbbh@noreply.gitea.io>
This commit is contained in:
parent
0c9963c637
commit
52855dae32
32
.drone.yml
32
.drone.yml
|
@ -11,7 +11,7 @@ trigger:
|
||||||
- refs/pull/*/head
|
- refs/pull/*/head
|
||||||
steps:
|
steps:
|
||||||
- name: test-vet
|
- name: test-vet
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
pull: always
|
pull: always
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
|
@ -19,7 +19,7 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- make vet
|
- make vet
|
||||||
- name: test-sqlite3
|
- name: test-sqlite3
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -31,7 +31,7 @@ steps:
|
||||||
- make test-sqlite3
|
- make test-sqlite3
|
||||||
- TEST_CACHE_ENABLE=true make test-sqlite3
|
- TEST_CACHE_ENABLE=true make test-sqlite3
|
||||||
- name: test-sqlite
|
- name: test-sqlite
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -41,7 +41,7 @@ steps:
|
||||||
- make test-sqlite
|
- make test-sqlite
|
||||||
- TEST_QUOTE_POLICY=reserved make test-sqlite
|
- TEST_QUOTE_POLICY=reserved make test-sqlite
|
||||||
- name: test-mysql
|
- name: test-mysql
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
pull: never
|
pull: never
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
|
@ -58,7 +58,7 @@ steps:
|
||||||
- TEST_CACHE_ENABLE=true make test-mysql
|
- TEST_CACHE_ENABLE=true make test-mysql
|
||||||
|
|
||||||
- name: test-mysql-utf8mb4
|
- name: test-mysql-utf8mb4
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
pull: never
|
pull: never
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
|
@ -98,7 +98,7 @@ trigger:
|
||||||
- refs/pull/*/head
|
- refs/pull/*/head
|
||||||
steps:
|
steps:
|
||||||
- name: test-mysql8
|
- name: test-mysql8
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
pull: never
|
pull: never
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
|
@ -136,7 +136,7 @@ trigger:
|
||||||
- refs/pull/*/head
|
- refs/pull/*/head
|
||||||
steps:
|
steps:
|
||||||
- name: test-mariadb
|
- name: test-mariadb
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
pull: never
|
pull: never
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
|
@ -175,7 +175,7 @@ trigger:
|
||||||
steps:
|
steps:
|
||||||
- name: test-postgres
|
- name: test-postgres
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -190,7 +190,7 @@ steps:
|
||||||
|
|
||||||
- name: test-postgres-schema
|
- name: test-postgres-schema
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -207,7 +207,7 @@ steps:
|
||||||
|
|
||||||
- name: test-pgx
|
- name: test-pgx
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -225,7 +225,7 @@ steps:
|
||||||
|
|
||||||
- name: test-pgx-schema
|
- name: test-pgx-schema
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -267,7 +267,7 @@ trigger:
|
||||||
steps:
|
steps:
|
||||||
- name: test-mssql
|
- name: test-mssql
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -306,7 +306,7 @@ trigger:
|
||||||
steps:
|
steps:
|
||||||
- name: test-tidb
|
- name: test-tidb
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -339,7 +339,7 @@ trigger:
|
||||||
steps:
|
steps:
|
||||||
- name: test-cockroach
|
- name: test-cockroach
|
||||||
pull: never
|
pull: never
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /go/pkg/mod
|
path: /go/pkg/mod
|
||||||
|
@ -375,7 +375,7 @@ services:
|
||||||
# steps:
|
# steps:
|
||||||
# - name: test-dameng
|
# - name: test-dameng
|
||||||
# pull: never
|
# pull: never
|
||||||
# image: golang:1.15
|
# image: golang:1.17
|
||||||
# volumes:
|
# volumes:
|
||||||
# - name: cache
|
# - name: cache
|
||||||
# path: /go/pkg/mod
|
# path: /go/pkg/mod
|
||||||
|
@ -416,7 +416,7 @@ trigger:
|
||||||
- refs/pull/*/head
|
- refs/pull/*/head
|
||||||
steps:
|
steps:
|
||||||
- name: merge_coverage
|
- name: merge_coverage
|
||||||
image: golang:1.15
|
image: golang:1.17
|
||||||
commands:
|
commands:
|
||||||
- make coverage
|
- make coverage
|
||||||
|
|
||||||
|
|
13
doc.go
13
doc.go
|
@ -3,16 +3,15 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Package xorm is a simple and powerful ORM for Go.
|
Package xorm is a simple and powerful ORM for Go.
|
||||||
|
|
||||||
Installation
|
# Installation
|
||||||
|
|
||||||
Make sure you have installed Go 1.11+ and then:
|
Make sure you have installed Go 1.11+ and then:
|
||||||
|
|
||||||
go get xorm.io/xorm
|
go get xorm.io/xorm
|
||||||
|
|
||||||
Create Engine
|
# Create Engine
|
||||||
|
|
||||||
Firstly, we should create an engine for a database
|
Firstly, we should create an engine for a database
|
||||||
|
|
||||||
|
@ -21,7 +20,7 @@ Firstly, we should create an engine for a database
|
||||||
Method NewEngine's parameters are the same as sql.Open which depend drivers' implementation.
|
Method NewEngine's parameters are the same as sql.Open which depend drivers' implementation.
|
||||||
Generally, one engine for an application is enough. You can define it as a package variable.
|
Generally, one engine for an application is enough. You can define it as a package variable.
|
||||||
|
|
||||||
Raw Methods
|
# Raw Methods
|
||||||
|
|
||||||
XORM supports raw SQL execution:
|
XORM supports raw SQL execution:
|
||||||
|
|
||||||
|
@ -41,7 +40,7 @@ XORM supports raw SQL execution:
|
||||||
|
|
||||||
affected, err := engine.Exec("update user set .... where ...")
|
affected, err := engine.Exec("update user set .... where ...")
|
||||||
|
|
||||||
ORM Methods
|
# ORM Methods
|
||||||
|
|
||||||
There are 8 major ORM methods and many helpful methods to use to operate database.
|
There are 8 major ORM methods and many helpful methods to use to operate database.
|
||||||
|
|
||||||
|
@ -142,7 +141,7 @@ or
|
||||||
sumInt64s, err := engine.SumsInt(&user, "id1", "id2")
|
sumInt64s, err := engine.SumsInt(&user, "id1", "id2")
|
||||||
// SELECT sum(id1), sum(id2) from user
|
// SELECT sum(id1), sum(id2) from user
|
||||||
|
|
||||||
Conditions
|
# Conditions
|
||||||
|
|
||||||
The above 8 methods could use with condition methods chainable.
|
The above 8 methods could use with condition methods chainable.
|
||||||
Notice: the above 8 methods should be the last chainable method.
|
Notice: the above 8 methods should be the last chainable method.
|
||||||
|
@ -204,7 +203,7 @@ Notice: the above 8 methods should be the last chainable method.
|
||||||
engine.Join("LEFT", "userdetail", "user.id=userdetail.id").Find(&users)
|
engine.Join("LEFT", "userdetail", "user.id=userdetail.id").Find(&users)
|
||||||
//SELECT * FROM user LEFT JOIN userdetail ON user.id=userdetail.id
|
//SELECT * FROM user LEFT JOIN userdetail ON user.id=userdetail.id
|
||||||
|
|
||||||
Builder
|
# Builder
|
||||||
|
|
||||||
xorm could work with xorm.io/builder directly.
|
xorm could work with xorm.io/builder directly.
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build dm
|
||||||
// +build dm
|
// +build dm
|
||||||
|
|
||||||
package integrations
|
package integrations
|
||||||
|
|
|
@ -744,7 +744,8 @@ func TestInsertMap(t *testing.T) {
|
||||||
assert.EqualValues(t, "lunny", ims[3].Name)
|
assert.EqualValues(t, "lunny", ims[3].Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*INSERT INTO `issue` (`repo_id`, `poster_id`, ... ,`name`, `content`, ... ,`index`)
|
/*
|
||||||
|
INSERT INTO `issue` (`repo_id`, `poster_id`, ... ,`name`, `content`, ... ,`index`)
|
||||||
SELECT $1, $2, ..., $14, $15, ..., MAX(`index`) + 1 FROM `issue` WHERE `repo_id` = $1;
|
SELECT $1, $2, ..., $14, $15, ..., MAX(`index`) + 1 FROM `issue` WHERE `repo_id` = $1;
|
||||||
*/
|
*/
|
||||||
func TestInsertWhere(t *testing.T) {
|
func TestInsertWhere(t *testing.T) {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build gojson
|
||||||
// +build gojson
|
// +build gojson
|
||||||
|
|
||||||
package json
|
package json
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build jsoniter
|
||||||
// +build jsoniter
|
// +build jsoniter
|
||||||
|
|
||||||
package json
|
package json
|
||||||
|
|
|
@ -163,6 +163,7 @@ func (q Quoter) quoteWordTo(buf *strings.Builder, word string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuoteTo quotes the table or column names. i.e. if the quotes are [ and ]
|
// QuoteTo quotes the table or column names. i.e. if the quotes are [ and ]
|
||||||
|
//
|
||||||
// name -> [name]
|
// name -> [name]
|
||||||
// `name` -> [name]
|
// `name` -> [name]
|
||||||
// [name] -> [name]
|
// [name] -> [name]
|
||||||
|
|
|
@ -145,6 +145,7 @@ func (session *Session) cacheUpdate(table *schemas.Table, tableName, sqlStr stri
|
||||||
// Update records, bean's non-empty fields are updated contents,
|
// Update records, bean's non-empty fields are updated contents,
|
||||||
// condiBean' non-empty filds are conditions
|
// condiBean' non-empty filds are conditions
|
||||||
// CAUTION:
|
// CAUTION:
|
||||||
|
//
|
||||||
// 1.bool will defaultly be updated content nor conditions
|
// 1.bool will defaultly be updated content nor conditions
|
||||||
// You should call UseBool if you have bool to use.
|
// You should call UseBool if you have bool to use.
|
||||||
// 2.float32 & float64 may be not inexact as conditions
|
// 2.float32 & float64 may be not inexact as conditions
|
||||||
|
|
Loading…
Reference in New Issue