Files
gf/contrib/drivers/tidb/go.mod

45 lines
1.6 KiB
Modula-2
Raw Permalink Normal View History

feat(contrib/drivers): more database drivers (#4553) This pull request adds first-class support for MariaDB, TiDB, OceanBase, and GaussDB as separate database drivers in the GoFrame ecosystem, rather than relying solely on MySQL compatibility. It introduces new driver packages for each database, updates documentation to reflect these additions, and adjusts dependency management files accordingly. The changes also deprecate the MariaDB-specific logic in the MySQL driver in favor of the new dedicated MariaDB driver. **New Database Driver Support** * Added new driver packages for MariaDB, TiDB, OceanBase, and GaussDB under `contrib/drivers/`, each with their own Go module files and driver implementation that wraps the MySQL driver for protocol compatibility and future extensibility. [[1]](diffhunk://#diff-0dd9dca0fb712c3691a95186853d1fc38a30a74ba34cbdc9aa6facee5457d681R1-R48) [[2]](diffhunk://#diff-23c6a84d45f3b30ae7ab1a95dec0b30329e702923cc74c5344b3606237ddd929R1-R44) [[3]](diffhunk://#diff-a8a6766c0d5b9c0788d0276b41b33fdbe786e0584fda19fd26db715bcf46fbcdR1-R48) [[4]](diffhunk://#diff-2cbf2f66d5cb77d9f4d00e4c0ce45055620fff50c941a588da31729f09a81f1bR1-R44) [[5]](diffhunk://#diff-4f0d2a9160a039ccdf1dc98205ed7cd9f3bb8d606fed57c5a4813937eecca81fR1-R47) [[6]](diffhunk://#diff-accbd2d37d45e51db3fcb0468043b1e1fd53eeac9e3d3558467ef24444188d2fR1-R44) [[7]](diffhunk://#diff-15fac9b8e76d2782594c91da72f6a6f42fc18e359c3be35bf6564ac3ca09f700R1-R44) * Registered these new drivers in the main module's `go.mod` and `go.work` files for proper dependency resolution and local development. [[1]](diffhunk://#diff-ee0abb9c50b9f91f424349123e31b7b1ba1e1e4f7497250422696c5bda2e74ceR12-R15) [[2]](diffhunk://#diff-a70c108de96ca9b56b7768254143b2b9f20ce1dcab51d92ce083fdfcba2efd6cR17-R20) **Documentation Updates** * Expanded the `contrib/drivers/README.MD` to include installation and import instructions for the new drivers, and clarified the supported drivers section with dedicated code examples for each. [[1]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299R12-R24) [[2]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299L46-R80) **MariaDB Driver Enhancements** * Implemented a MariaDB-specific `TableFields` method and SQL query in the new driver, improving the accuracy of table field retrieval for MariaDB databases. * Added unit test initialization code for MariaDB to ensure driver functionality. **Deprecation and Refactoring** * Marked the MariaDB-specific logic and SQL in the MySQL driver as deprecated, with a note to remove it in the next version, directing users to the new MariaDB driver instead. [[1]](diffhunk://#diff-9892cdfb158af82d92f3bfe9e418011bd47a0596638428e61c70993dd72b9c47R18-R20) [[2]](diffhunk://#diff-9892cdfb158af82d92f3bfe9e418011bd47a0596638428e61c70993dd72b9c47R74-R75) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Lance Add <1196661499@qq.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-09 16:33:55 +08:00
module github.com/gogf/gf/contrib/drivers/tidb/v2
go 1.23.0
require (
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.2
github.com/gogf/gf/v2 v2.10.2
feat(contrib/drivers): more database drivers (#4553) This pull request adds first-class support for MariaDB, TiDB, OceanBase, and GaussDB as separate database drivers in the GoFrame ecosystem, rather than relying solely on MySQL compatibility. It introduces new driver packages for each database, updates documentation to reflect these additions, and adjusts dependency management files accordingly. The changes also deprecate the MariaDB-specific logic in the MySQL driver in favor of the new dedicated MariaDB driver. **New Database Driver Support** * Added new driver packages for MariaDB, TiDB, OceanBase, and GaussDB under `contrib/drivers/`, each with their own Go module files and driver implementation that wraps the MySQL driver for protocol compatibility and future extensibility. [[1]](diffhunk://#diff-0dd9dca0fb712c3691a95186853d1fc38a30a74ba34cbdc9aa6facee5457d681R1-R48) [[2]](diffhunk://#diff-23c6a84d45f3b30ae7ab1a95dec0b30329e702923cc74c5344b3606237ddd929R1-R44) [[3]](diffhunk://#diff-a8a6766c0d5b9c0788d0276b41b33fdbe786e0584fda19fd26db715bcf46fbcdR1-R48) [[4]](diffhunk://#diff-2cbf2f66d5cb77d9f4d00e4c0ce45055620fff50c941a588da31729f09a81f1bR1-R44) [[5]](diffhunk://#diff-4f0d2a9160a039ccdf1dc98205ed7cd9f3bb8d606fed57c5a4813937eecca81fR1-R47) [[6]](diffhunk://#diff-accbd2d37d45e51db3fcb0468043b1e1fd53eeac9e3d3558467ef24444188d2fR1-R44) [[7]](diffhunk://#diff-15fac9b8e76d2782594c91da72f6a6f42fc18e359c3be35bf6564ac3ca09f700R1-R44) * Registered these new drivers in the main module's `go.mod` and `go.work` files for proper dependency resolution and local development. [[1]](diffhunk://#diff-ee0abb9c50b9f91f424349123e31b7b1ba1e1e4f7497250422696c5bda2e74ceR12-R15) [[2]](diffhunk://#diff-a70c108de96ca9b56b7768254143b2b9f20ce1dcab51d92ce083fdfcba2efd6cR17-R20) **Documentation Updates** * Expanded the `contrib/drivers/README.MD` to include installation and import instructions for the new drivers, and clarified the supported drivers section with dedicated code examples for each. [[1]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299R12-R24) [[2]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299L46-R80) **MariaDB Driver Enhancements** * Implemented a MariaDB-specific `TableFields` method and SQL query in the new driver, improving the accuracy of table field retrieval for MariaDB databases. * Added unit test initialization code for MariaDB to ensure driver functionality. **Deprecation and Refactoring** * Marked the MariaDB-specific logic and SQL in the MySQL driver as deprecated, with a note to remove it in the next version, directing users to the new MariaDB driver instead. [[1]](diffhunk://#diff-9892cdfb158af82d92f3bfe9e418011bd47a0596638428e61c70993dd72b9c47R18-R20) [[2]](diffhunk://#diff-9892cdfb158af82d92f3bfe9e418011bd47a0596638428e61c70993dd72b9c47R74-R75) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Lance Add <1196661499@qq.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-09 16:33:55 +08:00
)
require (
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods/v2 v2.0.0-alpha // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/olekukonko/tablewriter v1.1.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.38.0 // indirect
go.opentelemetry.io/otel/metric v1.38.0 // indirect
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace (
github.com/gogf/gf/contrib/drivers/mysql/v2 => ../mysql
github.com/gogf/gf/v2 => ../../../
)