maktub
8f5e437a61
fix: correct nullable field detection logic in column metadata ( #2520 )
...
fix: correct nullable field detection logic in column metadata
gbase8s metadata: N == NOT NULL
Co-authored-by: zhangyunfei <zhangyunfei@gbase.cn>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2520
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: maktub <maktub@noreply.gitea.com>
Co-committed-by: maktub <maktub@noreply.gitea.com>
2025-07-21 18:24:41 +00:00
Lunny Xiao
b72e98f60e
Fix bug when json with a real SQLType in the tag ( #2519 )
...
Fix a bug when the tag have both `longtext json`. It should be `longtext` column type with JSON support.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2519
2025-07-21 18:19:39 +00:00
maktub
89d1238248
feat: Support GBase8s Database ( #2517 )
...
## Background
Currently, XORM does not yet support the [GBase 8s database by Nanda General Data Technology]. GBase 8s is a widely used domestic database in China, commonly adopted by enterprises and government systems as a backend storage solution.
## Summary of This Contribution
• Added support for the gbase8s driver
• Implemented a basic database dialect: GBase8sDialect
## Usage Instructions
```go
import _ "gitee.com/GBase8s/go-gci""
engine, err := xorm.NewEngine("gbase8s", "gbase8s://username:pwd@ip:port/dbname?param=xxx")
Co-authored-by: zhangyunfei <zhangyunfei@gbase.cn>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2517
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: maktub <maktub@noreply.gitea.com>
Co-committed-by: maktub <maktub@noreply.gitea.com>
2025-07-18 02:59:03 +00:00
Kos
f50aacd38b
fix oracle date field insert ( #2420 )
...
for #2419
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2420
Co-authored-by: Kos <kos@noreply.gitea.com>
Co-committed-by: Kos <kos@noreply.gitea.com>
2025-05-26 02:54:40 +00:00
Lunny Xiao
3b3f99f8a1
Add security scan ( #2454 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2454
2025-03-14 17:04:18 +00:00
Lunny Xiao
cc4be22330
Disable cockroach tempororily
2025-03-12 11:07:52 -07:00
Lunny Xiao
cd0ca0bbc6
Update badges on README
2025-03-12 11:02:35 -07:00
cenxiao
844543c7da
fix drop index SQL for Oracle ( #2469 )
...
Adjust drop index SQL to work with Oracle Autonomous DB
Issue:
DROP INDEX IDX_casdoor_permission_rule_PTYPE ON casdoor_permission_rule
Error report -
ORA-00933: SQL command not properly ended
Expected:
DROP INDEX IDX_casdoor_permission_rule_PTYPE
Co-authored-by: Cenxiao Zhao <cenxiao@projectboard.world>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2469
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: cenxiao <cenxiao@noreply.gitea.com>
Co-committed-by: cenxiao <cenxiao@noreply.gitea.com>
2025-02-28 06:26:20 +00:00
techknowlogick
7654b7b749
add libsql as a valid driver type ( #2481 )
...
support the libsql sqlite driver library https://github.com/tursodatabase/go-libsql
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2481
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-committed-by: techknowlogick <techknowlogick@noreply.gitea.com>
2024-12-06 17:26:39 +00:00
Lunny Xiao
d47f35b260
Branch name change ( #2459 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2459
2024-05-15 08:45:25 +00:00
Lunny Xiao
cbbd1f09e1
Add more tests for extends ( #2443 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2443
2024-05-09 12:47:01 +00:00
lijunshi
c6d05fa553
fix: Sync2 will remove AUTO_INCREMENT unexpectly ( #2444 ) ( #2445 )
...
fix #2444
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2445
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: lijunshi <lijunshi2015@163.com>
Co-committed-by: lijunshi <lijunshi2015@163.com>
2024-04-28 16:12:17 +00:00
Dacian S
3bc2ea24f6
suwro ( #2453 )
...
please release v1.3.10
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Dacian Stanciu <dacian.stanciu@just.ro>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2453
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Dacian S <suwro@noreply.gitea.com>
Co-committed-by: Dacian S <suwro@noreply.gitea.com>
2024-04-27 14:14:15 +00:00
Dacian Stanciu
4e74c80b67
fix: Legacy MsSQL - legacy offset select sql command bug #2446 ( #2448 )
...
fix for MsSQL legacy bug
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2448
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Dacian Stanciu <daci28@yahoo.com>
Co-committed-by: Dacian Stanciu <daci28@yahoo.com>
2024-04-24 13:47:05 +00:00
Lunny Xiao
8094e98a8f
Fix ci ( #2449 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2449
2024-04-24 11:37:00 +00:00
tylerthail2019
589acfff86
Add includeNil requiredField Check when custom struct field IsZero in Update method. ( #2438 )
...
Add includeNil requiredField Check when custom struct field IsZero in Update method.
Co-authored-by: tyler <tyler@mbp.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2438
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: tylerthail2019 <tylerthail2019@noreply.gitea.com>
Co-committed-by: tylerthail2019 <tylerthail2019@noreply.gitea.com>
2024-04-02 04:26:41 +00:00
tylerthail2019
34e62e9b4c
add IsZero check for custom struct column in the Update method ( #2417 )
...
Co-authored-by: tyler <tyler@mbp.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2417
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: tylerthail2019 <tylerthail2019@noreply.gitea.com>
Co-committed-by: tylerthail2019 <tylerthail2019@noreply.gitea.com>
2024-03-18 06:43:33 +00:00
appleboy
be77a7084b
refactor: ensure non-null values in migration table creation ( #2434 )
...
- Change the migration table creation to not allow null values for the column
fix https://gitea.com/xorm/xorm/issues/2433
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2434
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2024-03-17 03:53:16 +00:00
Lunny Xiao
7a535a7899
Update ci ( #2432 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2432
2024-03-15 14:11:47 +00:00
Lunny Xiao
2e2a66c640
Support not drop index when sync ( #2429 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2429
2024-03-15 03:13:09 +00:00
CyJaySong
63222312b2
Fix the issue of incorrect insertion of data in non UTC time zone zero for numeric types ( #2413 )
...
Fix the issue of incorrect insertion of data in non-UTC time zone zero for numeric types
Co-authored-by: CyJay <cyjay@MacBook-Pro.lan>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2413
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: CyJaySong <CyJaySong@gmail.com>
Co-committed-by: CyJaySong <CyJaySong@gmail.com>
2024-02-25 16:16:56 +00:00
Lunny Xiao
0c9a2f6a70
Fix migrate schema bug ( #2407 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2407
2024-02-08 08:45:23 +00:00
Kos
11e96d9654
Update internal/statements/legacy_select.go ( #2400 )
...
fix #2399 , When Oracle enables USE_LEGACY_LIMIT_OFFSET, the Where condition fails
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Kos <kos@noreply.gitea.com>
Co-committed-by: Kos <kos@noreply.gitea.com>
2024-02-05 11:13:17 +00:00
zzdboy
5301cc0ae9
fix: dm Database Clob field conversion error ( #2405 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2405
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
2024-02-04 09:06:47 +00:00
James Marino
e884f059a4
fix: allow driver options to allow the customisation of the driver after database open call ( #2369 )
...
Function can now be passed in to allow customisation to the open database.
For example, with the Oracle database driver `sijms/go-ora` one may want to do the following:
```go
engine, err := xorm.NewEngine("oracle", connectionString, func(db *sql.DB) error {
return oracle.AddSessionParam(db, "NLS_TIMESTAMP_FORMAT", "RR-MM-DD HH24:MI:SS")
})
```
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2369
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: James Marino <james@marino.io>
Co-committed-by: James Marino <james@marino.io>
2024-01-22 08:24:18 +00:00
weeee9
ac3be4148e
Fix typo in session_get.go ( #2398 )
...
- Fix a typo in error message: "unspoorted" should be "unsupported"
Signed-off-by: weeee9 <teletubby332@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2398
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: weeee9 <teletubby332@gmail.com>
Co-committed-by: weeee9 <teletubby332@gmail.com>
2024-01-22 08:06:32 +00:00
Lunny Xiao
70c6978fc4
Use github.com/microsoft/go-mssqldb instead of old mssqldb repository ( #2386 ) ( #2390 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2386
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2390
2024-01-16 07:56:04 +00:00
Lunny Xiao
83fdc38834
Fix #2393 ( #2395 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2395
2024-01-15 14:06:34 +00:00
Lunny Xiao
a901ab8593
Fix readme links
2024-01-05 09:47:07 +08:00
Lunny Xiao
4992cba040
Fix test-mssql bug ( #2391 ) ( #2392 )
...
backport #2391
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2391
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2392
2024-01-01 02:44:35 +00:00
Lunny Xiao
6ce46e7fac
Fix mssql get indexes bug when collation is not default with collation test for mssql ( #2387 ) ( #2389 )
...
backport #2387
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2387
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2389
2023-12-31 14:39:33 +00:00
Lunny Xiao
5d57ef92f5
Upgrade minimal version from go 1.16 to go 1.18 ( #2388 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2388
2023-12-31 13:56:14 +00:00
Lunny Xiao
0398dee813
Implement update join ( #2383 ) ( #2385 )
...
backport #2383
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2383
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2385
2023-12-30 10:50:02 +00:00
Lunny Xiao
cc28d99161
Fix use hint with join bug ( #2384 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2384
2023-12-30 06:28:44 +00:00
Lunny Xiao
743f3bcab8
Upgrade to setup-go v5 ( #2381 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2381
2023-12-23 02:51:33 +00:00
Lunny Xiao
bdd8787d84
Use setup go v4 actions ( #2380 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2380
2023-12-20 07:01:32 +00:00
Lunny Xiao
7ae7474bcb
Add missing index hint parameter ( #2378 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2378
2023-12-19 04:54:04 +00:00
Lunny Xiao
b571d91858
Add index hint support ( #2375 )
...
Fix #1456
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2375
2023-12-15 02:17:13 +00:00
KN4CK3R
529a264d8e
Fix sqlite multiline query parse ( #2367 )
...
The app "DB Browser for SQLite" produces multiline queries in the `sqlite_master` table which xorm can't parse.
Examples:
```
CREATE TABLE "push_mirror"
(
id INTEGER not null
primary key autoincrement,
repo_id INTEGER,
remote_name TEXT,
interval INTEGER,
created_unix INTEGER,
last_update INTEGER,
last_error TEXT,
sync_on_commit INTEGER default 0 not null
, `remote_address` TEXT NULL)
```
```
CREATE INDEX "IDX_audit_event_action" ON "audit_event" (
"action"
)
```
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2367
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-committed-by: KN4CK3R <admin@oldschoolhack.me>
2023-12-01 07:07:35 +00:00
Lunny Xiao
c855ca4e59
Some refactors ( #2348 ) ( #2352 )
...
backport #2348
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2348
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2352
2023-10-27 14:01:14 +00:00
Lunny Xiao
6ef0a7798f
Fix bug when join with alias start with `a` ( #2343 )
...
Fix #2331
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2343
2023-10-25 11:01:46 +00:00
Lunny Xiao
0f085408af
some refactors for write functions ( #2342 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2342
2023-10-25 07:11:18 +00:00
lng2020
dbe499091a
Revert "Fix deleted tag attribute zeroTime is not DatabaseTZ ( #2299 )" ( #2341 )
...
Related #2339
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2341
Co-authored-by: lng2020 <nanguanlin6@gmail.com>
Co-committed-by: lng2020 <nanguanlin6@gmail.com>
2023-10-17 09:41:42 +00:00
zzdboy
3eda0f7805
fix KingbaseES version ( #2335 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2335
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
2023-09-24 03:52:50 +00:00
FlyingOnion
551de3767c
modify limit offset implement ( #2188 )
...
Oracle and SQLServer specific: When `LIMIT OFFSET` function is needed, use `OFFSET <offset> ROWS FETCH NEXT <limit> ROWS ONLY` to replace legacy subquery.
SQLServer specific: When `ORDER BY` is not set and `OFFSET FETCH` is set, set `statement.orderStr` to `1` (`ORDER BY 1`). See [here](https://learn.microsoft.com/zh-cn/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver16 ).
MySQL specific: When limit is 0 and offset > 0, use `LIMIT 9223372036854775807` ($2^{63}-1$). See comments [here](15d171ea55/internal/statements/query.go (L314)
).
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2188
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: FlyingOnion <731677080@qq.com>
Co-committed-by: FlyingOnion <731677080@qq.com>
2023-09-20 02:07:03 +00:00
Ryan Liu
ac88a5705a
fix the error in mysql: unknown colType UNSIGNED FLOAT ( #2143 )
...
Error: unknown colType UNSIGNED FLOAT
in mysql 5.6.27 or 5.7.32
Fix #2123
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2143
Co-authored-by: Ryan Liu <azhai@126.com>
Co-committed-by: Ryan Liu <azhai@126.com>
2023-09-16 15:43:12 +00:00
6543
e5be0f4129
Remove dead code from session.SyncWithOptions() ( #2323 )
...
db7c264062/sync.go (L229-L231)
as oriIndex only is **not** nil if index.Equal(index2)
and index.Equal(index2) check if `oriIndex.Type == index.Type` ... so it always is false
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2323
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2023-09-16 14:41:02 +00:00
zzdboy
2885c88b77
fix PostgreSQL version ( #2332 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2332
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
2023-09-16 13:49:19 +00:00
Lunny Xiao
407375c9b4
Add test for max ( id ) ( #2316 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2316
2023-09-16 13:48:49 +00:00
Lunny Xiao
eeacd22674
Fix ci ( #2330 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2330
2023-09-13 02:02:12 +00:00