mysql

package module
v1.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2025 License: MIT Imports: 6 Imported by: 0

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct{}

MySQL is an implementation of the IDatabase interface for MySQL.

func New

func New() *MySQL

New initializes a new MySQL driver instance and registers it to the database manager.

Returns:

*MySQL: A new instance of the MySQL driver.

func (*MySQL) Load

func (d *MySQL) Load() (*sqlx.DB, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL