125 Commits

Author SHA1 Message Date
gem
7b9c666f05 修改orm方法 2025-10-16 17:23:22 +08:00
llchry
5fa33bc11b Update db_oracle.go
fix dbbase.GetColumns  expected 3 destination arguments but only query one in oracle
2025-03-26 15:42:05 +08:00
luxcgo
0654bff7d5
use sync.Once to replace lock (#5710)
* use atomic operation to optimize performance

* use sync.Once to replace lock
2024-10-05 22:43:21 +08:00
Fahad Khan
cbfbf97af1 added BootStrap call in case where default db name is not used 2024-09-21 16:44:12 +08:00
LumenShip
bb43fb19d9 Update orm_log.go
Refactor debugLogQueries function in orm_log.go

The debugLogQueries function in orm_log.go was modified to fix typos, streamline the formatting of log entries, and include additional data. Key changes include the addition of new entries to logMap, including "alias_name", "operation", "query", "cons", and "err". DebugLog also replaces logs.DebugLog to output the log entry.
2024-07-06 16:56:52 +08:00
Ather Shu
30278539a6
feat: orm suppert SetConnMaxIdleTime (#5580) 2024-02-05 11:24:40 +08:00
Oleksandr Redko
426aad68dc
refactor: replace deprecated github.com/pkg/errors with errors pkg (#5577) 2024-02-02 22:56:28 +08:00
Ming Deng
95a8a61d2b
fix 5530: use orm.DebugLog (#5532)
* fix 5500: querySet should not be changed when constructing SQL

* fix 5530: use orm.DebugLog
2023-11-27 23:43:59 +08:00
Ming Deng
e4b67e86ee
fix 5500: querySet should not be changed when constructing SQL (#5502) 2023-10-06 19:48:10 +08:00
Ming Deng
e465249ef6
orm: PostgreSQL change auto to bigserial (#5415) 2023-09-18 11:02:43 +08:00
smx_Morgan
c55099756c
support db_type in ddl (#5404)
* support db_type in ddl

* postgres test fixed

* CHANGELOG.md

* mysql bug
2023-09-14 21:59:30 +08:00
Uzziah
b2a37fe60e
fix: refactor Count method (#5300)
* fix: refactor Count method and add test

* fix: add the change record into the CHANGELOG.md

* fix: refactor the readSQL method and let countSQL reuse readSQL method

* fix: fix the bug in the construction process of the order by clause

* fix: modify the TestCountOrderBy、add the TestCount and TestOrderBy

* fix: move the change record in CHANGELOG.md to developing

---------

Co-authored-by: Ken <azai8599@163.com>
2023-09-12 00:18:04 +08:00
Uzziah
4eea71f1d7
fix: refactor readBatchSQL and readValuesSQL method to reuse readSQL (#5303)
* fix: refactor readBatchSQL and readValuesSQL method to reuse readSQL and add test of the readValuesSQL method

* fix: add the change record into the CHANGELOG.md

* fix: fix the bug for preprocess cols

* fix: resolve the conflict with develop

---------

Co-authored-by: Ken <azai8599@163.com>
2023-08-29 20:56:51 +08:00
Ming Deng
2d0da431cb
refactor: move the modelCache to internal/models package (#5306) 2023-08-28 21:10:31 +08:00
Uzziah
e9d3357643
fix: refactor ReadBatch method (#5298) 2023-08-23 18:35:17 +08:00
Uzziah
46a00d3592
fix: refactor InsertOrUpdate method in dbBase (#5296)
* fix: refactor InsertOrUpdate method in dbBase and add the test

* fix: add the change record to the CHANGELOG.md
2023-08-18 20:47:24 +08:00
Uzziah
a5eda3267a
fix: refactor UpdateBatch method (#5295) 2023-08-14 14:25:26 +08:00
mlgd
bd01665cb1
Fix setPK function for table without primary key (#5276) 2023-07-14 15:00:02 +08:00
Uzziah
24b41552c5
fix: refactor update sql (#5274)
* fix: refactor UpdateSQL method and add test

* fix: add modify record into CHANGELOG

* fix: modify url in the CHANGELOG

* fix: modify pr url in the CHANGELOG
2023-07-10 21:50:44 +08:00
Uzziah
957c526efb
fix: refactor Delete method (#5271)
* fix: refactor Delete method and add test

* fix: add modify record into CHANGELOG
2023-07-06 19:53:07 +08:00
Uzziah
fdcf2e9806
fix: modify InsertOrUpdate method (#5269)
* fix: modify InsertOrUpdate method, Remove the isMulti variable and its associated code

* fix: Delete unnecessary judgment branches

* fix: add modify record into CHANGELOG
2023-07-02 15:31:44 +08:00
Uzziah
20a5030842
fix: refactor InsertValue method (#5267)
* fix: refactor insertValue method and add the test

* fix: exec goimports and add Licence file header

* fix: modify construct method of dbBase

* fix: add modify record into CHANGELOG
2023-06-29 21:33:46 +08:00
Ming Deng
1047faadfb
cache/redis: support skipEmptyPrefix option (#5264) 2023-06-26 13:41:08 +08:00
Kota
6f803ec9a9
fix: use of ioutil package (#5261)
* fix ioutil.NopCloser

* fix ioutil.ReadAll

* fix ioutil.ReadFile

* fix ioutil.WriteFile

* run goimports -w -format-only ./

* update CHANGELOG.md
2023-06-25 18:48:23 +08:00
Deng Ming
3673a322a6 closes 5254: %COL% should be a common placeholder 2023-06-20 17:21:40 +08:00
Deng Ming
bc63be6d13 fix 5255: Check the rows.Err() if rows.Next() is false 2023-06-20 16:07:23 +08:00
Deng Ming
34c5f1d54d Merge branch 'develop' of github.com:beego/beego into develop 2023-06-08 23:51:55 +08:00
Deng Ming
059c504132 orm: refactor ORM introducing internal/models pkg 2023-06-08 22:46:28 +08:00
guoguangwu
1c574a893e chore: unnecessary use of fmt.Sprintf 2023-06-08 13:39:02 +08:00
Deng Ming
3e96b23551 httplib: fix unstable test, do not use httplib.org 2023-06-04 14:32:51 +08:00
cui fliter
53d9e8be69
fix some comments (#5194)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-21 13:48:06 +08:00
Deng Ming
5ade9fa025 format code 2022-12-23 11:31:00 +08:00
王哈哈
1bb607b286
Modify comment syntax error (#5094) 2022-11-10 18:22:37 +08:00
Regan Yue
493e7db20b
refine comments for for four files (#5011)
* refine comments for cache.go

* refine comments for log.go

* Update orm.go

* refine comments for orm_log.go,types.go

* Update utils.go

* Update doc.go

* Update db.go
2022-07-09 18:10:19 +08:00
Ming Deng
5a873ea0f0
Merge pull request #4950 from Dokiys/feature/orm_otel_filter
Feat: add orm opentelemetry filter
2022-05-30 23:20:55 +08:00
Dokiy
f2c28be167 feat: add orm opentelemetry filter 2022-05-29 21:47:53 +08:00
Ming Deng
daf779ffca
Merge pull request #4953 from greenhandatsjtu/feat/refactor-orm
Refactor ORM: rename _modelCache struct to modelCache
2022-05-22 16:36:20 +08:00
greenhandatsjtu
ada107b3fe refine unit tests for getDbCreateSQL 2022-05-21 19:55:33 +08:00
greenhandatsjtu
f9d2b4cb9a Refactor ORM: rename _modelCache struct to modelCache 2022-05-21 10:06:31 +08:00
greenhandatsjtu
a539289b20 Add unit test for getDbCreateSQL() 2022-05-19 14:26:23 +08:00
greenhandatsjtu
d150d85bfd Append column comments to create table sentence when using postgres 2022-05-14 15:17:38 +08:00
Deng Ming
3e886f71ca replace beego.me with beego.vip 2021-11-29 21:29:29 +08:00
snehalyelmati
e16fcd46ba SCC-S1023 Redundant control flow fix 2021-10-20 20:36:35 +05:30
Cr
b1fbaa71c3
refactor: fix deepsource analyze 2021-09-07 09:51:33 +08:00
Cr
47f9746e11
refactor: fix deepsource analyze 2021-09-07 09:43:27 +08:00
Cr
7abf5669e4
refactor(wip): fix deepsource analyze 2021-09-06 16:48:22 +08:00
Cr
915cdb94bc
refactor(wip): fix deepsource analyze 2021-09-06 16:04:03 +08:00
Cr
d6866b6b2e
refactor(wip): fix deepsource analyze 2021-09-06 14:05:19 +08:00
Cr
0e9b2c27ea
fix(orm): txOrm miss debug log 2021-09-03 14:23:09 +08:00
Ming Deng
4437c6eb11 merge master 2021-09-03 11:40:13 +08:00