mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
Merge branch 'gogf:master' into master
This commit is contained in:
@ -1,15 +1,30 @@
|
||||
# drivers
|
||||
Database drivers for package gdb.
|
||||
Powerful database drivers for package gdb.
|
||||
|
||||
# Installation
|
||||
Let's take `pgsql` for example.
|
||||
Let's take `mysql` for example.
|
||||
```
|
||||
go get -u github.com/gogf/gf/contrib/drivers/pgsql/v2
|
||||
go get -u github.com/gogf/gf/contrib/drivers/mysql/v2
|
||||
```
|
||||
|
||||
Choose and import the driver to your project:
|
||||
```
|
||||
import _ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
|
||||
import _ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
```
|
||||
|
||||
Commonly imported at top of `main.go`:
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
// Other imported packages.
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Main logics.
|
||||
}
|
||||
```
|
||||
|
||||
# Supported Drivers
|
||||
|
||||
Reference in New Issue
Block a user