sqldb

package
v0.0.0-...-d33de98 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "sqldb"
)

Name for this module

Variables

This section is empty.

Functions

func Module

func Module() (string, tengo.Importable)

Module stores information for this module name

func RegisterDB

func RegisterDB(name, driverName string, db *sql.DB) error

RegisterDB register existing sql.DB instance. Supported driver names:

  • With $ params: "postgres", "pgx", "pq-timeouts", "cloudsqlpostgres", "ql", "nrpostgres", "cockroach",
  • With ? params: "mysql", "sqlite3", "nrmysql", "nrsqlite3",
  • with :name params: "oci8", "ora", "goracle", "godror",
  • with @ params: "sqlserver",

func RegisterDBX

func RegisterDBX(name string, dbx *sqlx.DB) error

RegisterDBX register sqlx.DB instance

func ReplaceDB

func ReplaceDB(name, driverName string, db *sql.DB) (*sqlx.DB, error)

ReplaceDB with new instance

func ReplaceDBX

func ReplaceDBX(name string, dbx *sqlx.DB) (*sqlx.DB, error)

ReplaceDBX with new instance

Types

type Config

type Config struct {
	DriverName     string `json:"driverName"`
	DataSourceName string `json:"dataSourceName"`
}

Config stores configuration to sqldatabase

Jump to

Keyboard shortcuts

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