Categorygithub.com/ginx-contribs/dbx
repositorypackage
1.0.1
Repository: https://github.com/ginx-contribs/dbx.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

dbx

dbx is a database/sql helper, support follow driver:

  • mysql
  • postgres
  • sqlite
  • sqlserver

install

go get github.com/ginx-contribs/dbx@latest

usage

here is a sqlite example as follows

package main

import (
	"github.com/ginx-contribs/dbx"
	"log"
)

func main() {
	sqldb, err := dbx.Open(dbx.Options{
		Driver:   dbx.Sqlite,
		Database: "test.db",
	})

	if err != nil {
		log.Fatal(err)
	}

	sqldb.Ping()
}