gf/contrib/drivers
2022-05-25 16:22:46 +08:00
..
clickhouse upgrade ClickHouse dependencies to V2 (#1772) 2022-05-23 21:21:59 +08:00
mssql fix issue missing mysql driver import for package contrib/drivers/mysql 2022-05-19 15:02:15 +08:00
mysql improve FieldsPrefix for gdb.Model 2022-05-25 16:22:46 +08:00
oracle fix issue missing mysql driver import for package contrib/drivers/mysql 2022-05-19 15:02:15 +08:00
pgsql go mod tidy 2022-05-19 10:49:09 +08:00
sqlite fix issue missing mysql driver import for package contrib/drivers/mysql 2022-05-19 15:02:15 +08:00
README.md upgrade ClickHouse dependencies to V2 (#1772) 2022-05-23 21:21:59 +08:00

drivers

Powerful database drivers for package gdb.

Installation

Let's take mysql for example.

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/mysql/v2"

Commonly imported at top of main.go:

package main

import (
	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"

	// Other imported packages.
)

func main() {
	// Main logics.
}

Supported Drivers

MySQL/MariaDB/TiDB

import _ "github.com/gogf/gf/contrib/drivers/mysql/v2"

SQLite

import _ "github.com/gogf/gf/contrib/drivers/sqlite/v2"

Note:

  • It does not support Save/Replace features.

PostgreSQL

import _ "github.com/gogf/gf/contrib/drivers/pgsql/v2"

Note:

  • It does not support Save/Replace features.
  • It does not support LastInsertId.

SQL Server

import _ "github.com/gogf/gf/contrib/drivers/mssql/v2"

Note:

  • It does not support Save/Replace features.
  • It does not support LastInsertId.
  • It supports server version >= SQL Server2005

Oracle

import _ "github.com/gogf/gf/contrib/drivers/oracle/v2"

Note:

  • It does not support Save/Replace features.
  • It does not support LastInsertId.

ClickHouse

import _ "github.com/gogf/gf/contrib/drivers/clickhouse/v2"

Note:

  • It does not support InsertIgnore/InsertGetId features.
  • It does not support Save/Replace features.
  • It does not support Transaction feature.
  • It does not support RowsAffected feature.

Custom Drivers

It's quick and easy, please refer to current driver source. It's quite appreciated if any PR for new drivers support into current repo.