mirror of https://github.com/go-gorm/gorm.git
Merge branch 'go-gorm:master' into bennett/deterministic-index-order
This commit is contained in:
commit
f26bd14e4c
|
@ -0,0 +1,20 @@
|
|||
name-template: 'v Release $NEXT_PATCH_VERSION 🌈'
|
||||
tag-template: 'v$NEXT_PATCH_VERSION'
|
||||
categories:
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
- 'feature'
|
||||
- 'enhancement'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- 'fix'
|
||||
- 'bugfix'
|
||||
- 'bug'
|
||||
- title: '🧰 Maintenance'
|
||||
label: 'chore'
|
||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&'
|
||||
template: |
|
||||
## Changes
|
||||
|
||||
$CHANGES
|
|
@ -0,0 +1,31 @@
|
|||
name: Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate Release Notes and Publish
|
||||
id: generate_release_notes
|
||||
uses: release-drafter/release-drafter@v6
|
||||
with:
|
||||
config-name: 'release-drafter.yml'
|
||||
name: "Release ${{ github.ref_name }}"
|
||||
tag: ${{ github.ref_name }}
|
||||
publish: true
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -176,17 +176,15 @@ jobs:
|
|||
|
||||
services:
|
||||
mssql:
|
||||
image: mcmoe/mssqldocker:latest
|
||||
image: mcr.microsoft.com/mssql/server:2022-latest
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
ACCEPT_EULA: Y
|
||||
SA_PASSWORD: LoremIpsum86
|
||||
MSSQL_DB: gorm
|
||||
MSSQL_USER: gorm
|
||||
MSSQL_PASSWORD: LoremIpsum86
|
||||
MSSQL_SA_PASSWORD: LoremIpsum86
|
||||
ports:
|
||||
- 9930:1433
|
||||
options: >-
|
||||
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P LoremIpsum86 -l 30 -Q \"SELECT 1\" || exit 1"
|
||||
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P ${MSSQL_SA_PASSWORD} -N -C -l 30 -Q \"SELECT 1\" || exit 1"
|
||||
--health-start-period 10s
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
|
@ -208,7 +206,7 @@ jobs:
|
|||
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
|
||||
|
||||
- name: Tests
|
||||
run: GITHUB_ACTION=true GORM_DIALECT=sqlserver GORM_DSN="sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm" ./tests/tests_all.sh
|
||||
run: GITHUB_ACTION=true GORM_DIALECT=sqlserver GORM_DSN="sqlserver://sa:LoremIpsum86@localhost:9930?database=master" ./tests/tests_all.sh
|
||||
|
||||
tidb:
|
||||
strategy:
|
||||
|
|
6
gorm.go
6
gorm.go
|
@ -189,6 +189,12 @@ func Open(dialector Dialector, opts ...Option) (db *DB, err error) {
|
|||
_ = db.Close()
|
||||
}
|
||||
}
|
||||
|
||||
if config.TranslateError {
|
||||
if _, ok := db.Dialector.(ErrorTranslator); !ok {
|
||||
config.Logger.Warn(context.Background(), "The TranslateError option is enabled, but the Dialector %s does not implement ErrorTranslator.", db.Dialector.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if config.PrepareStmt {
|
||||
|
|
|
@ -18,16 +18,13 @@ services:
|
|||
- POSTGRES_USER=gorm
|
||||
- POSTGRES_PASSWORD=gorm
|
||||
mssql:
|
||||
image: '${MSSQL_IMAGE:-mcmoe/mssqldocker}:latest'
|
||||
image: '${MSSQL_IMAGE}:2022-latest'
|
||||
ports:
|
||||
- "127.0.0.1:9930:1433"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- ACCEPT_EULA=Y
|
||||
- SA_PASSWORD=LoremIpsum86
|
||||
- MSSQL_DB=gorm
|
||||
- MSSQL_USER=gorm
|
||||
- MSSQL_PASSWORD=LoremIpsum86
|
||||
- MSSQL_SA_PASSWORD=LoremIpsum86
|
||||
tidb:
|
||||
image: 'pingcap/tidb:v6.5.0'
|
||||
ports:
|
||||
|
|
|
@ -27,7 +27,7 @@ if [[ -z $GITHUB_ACTION ]]; then
|
|||
SQLCMDPASSWORD=LoremIpsum86 sqlcmd -U sa -S localhost:9930 -Q "IF SUSER_ID (N'gorm') IS NULL CREATE LOGIN gorm WITH PASSWORD = 'LoremIpsum86';" > /dev/null || true
|
||||
SQLCMDPASSWORD=LoremIpsum86 sqlcmd -U sa -S localhost:9930 -Q "IF USER_ID (N'gorm') IS NULL CREATE USER gorm FROM LOGIN gorm; ALTER SERVER ROLE sysadmin ADD MEMBER [gorm];" > /dev/null || true
|
||||
else
|
||||
docker compose up -d
|
||||
MSSQL_IMAGE=mcr.microsoft.com/mssql/server docker compose up -d
|
||||
fi
|
||||
cd ..
|
||||
fi
|
||||
|
|
|
@ -20,7 +20,7 @@ var DB *gorm.DB
|
|||
var (
|
||||
mysqlDSN = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"
|
||||
postgresDSN = "user=gorm password=gorm dbname=gorm host=localhost port=9920 sslmode=disable TimeZone=Asia/Shanghai"
|
||||
sqlserverDSN = "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"
|
||||
sqlserverDSN = "sqlserver://sa:LoremIpsum86@localhost:9930?database=master"
|
||||
tidbDSN = "root:@tcp(localhost:9940)/test?charset=utf8&parseTime=True&loc=Local"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue