package
module
Version:
v1.4.5
Opens a new window with list of versions in this module.
Published: May 8, 2025
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
gFly Database - MySQL
Copyright © 2023, gFly
https://www.gfly.dev
All rights reserved.
Fluent Model - flexible and powerful Data-Access Layer. Build on top of Fluent SQL
Usage
Install
go get -u github.com/gflydev/db@v1.0.0
go get -u github.com/gflydev/db/mysql@v1.1.0
Quick usage main.go
import (
mb "github.com/gflydev/db"
dbMySQL "github.com/gflydev/db/mysql"
)
func main() {
// Register DB driver & Load Model builder
mb.Register(dbMySQL.New())
mb.Load()
}
Documentation
¶
MySQL is an implementation of the IDatabase interface for MySQL.
New initializes a new MySQL driver instance and registers it to the database manager.
Returns:
*MySQL: A new instance of the MySQL driver.
Load establishes a connection to the MySQL database.
Returns:
*sqlx.DB: A pointer to the connected database instance.
error: An error instance if the connection fails; otherwise, nil.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.