adapters

package
v0.0.0-...-2327e9c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2023 Codoworks Author: Dexter Codo Contact: dexter.codo@gmail.com

Copyright © 2023 Codoworks Author: Dexter Codo Contact: dexter.codo@gmail.com

Copyright © 2023 Codoworks Author: Dexter Codo Contact: dexter.codo@gmail.com

Copyright © 2023 Codoworks Author: Dexter Codo Contact: dexter.codo@gmail.com

Index

Constants

This section is empty.

Variables

View Source
var Adapters = &Adapter{
	defaultPlatform: constants.DEFAULT_DB_PLATFORM,
	currentPlatform: constants.DEFAULT_DB_PLATFORM,
	adapters:        make(map[string]IAdapter),
}

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	IAdapter
	// contains filtered or unexported fields
}

func (*Adapter) AppendAdapter

func (a *Adapter) AppendAdapter(name string, adapter IAdapter)

func (*Adapter) GetDSN

func (a *Adapter) GetDSN() (string, error)

func (*Adapter) GetDbCreateStatement

func (a *Adapter) GetDbCreateStatement() (string, error)

func (*Adapter) GetDbDropStatement

func (a *Adapter) GetDbDropStatement() (string, error)

func (*Adapter) GetDriver

func (a *Adapter) GetDriver() (gorm.Dialector, error)

func (*Adapter) GetServerDSN

func (a *Adapter) GetServerDSN() (string, error)

func (*Adapter) GetServerDriver

func (a *Adapter) GetServerDriver() (gorm.Dialector, error)

func (*Adapter) SetConfig

func (a *Adapter) SetConfig(config features.DatabaseConfig)

func (*Adapter) ValidateConfig

func (a *Adapter) ValidateConfig() error

type IAdapter

type IAdapter interface {
	SetConfig(config features.DatabaseConfig)
	GetDriver() (gorm.Dialector, error)
	GetServerDriver() (gorm.Dialector, error)
	GetDSN() (string, error)
	GetServerDSN() (string, error)
	GetDbCreateStatement() (string, error)
	GetDbDropStatement() (string, error)
	ValidateConfig() error
}

type MySQLAdapter

type MySQLAdapter struct {
	IAdapter
	// contains filtered or unexported fields
}

func (*MySQLAdapter) GetDSN

func (a *MySQLAdapter) GetDSN() (string, error)

func (*MySQLAdapter) GetDbCreateStatement

func (a *MySQLAdapter) GetDbCreateStatement() (string, error)

func (*MySQLAdapter) GetDbDropStatement

func (a *MySQLAdapter) GetDbDropStatement() (string, error)

func (*MySQLAdapter) GetDriver

func (a *MySQLAdapter) GetDriver() (gorm.Dialector, error)

func (*MySQLAdapter) GetServerDSN

func (a *MySQLAdapter) GetServerDSN() (string, error)

func (*MySQLAdapter) GetServerDriver

func (a *MySQLAdapter) GetServerDriver() (gorm.Dialector, error)

func (*MySQLAdapter) SetConfig

func (a *MySQLAdapter) SetConfig(config features.DatabaseConfig)

func (*MySQLAdapter) ValidateConfig

func (a *MySQLAdapter) ValidateConfig() error

type PostgresAdapter

type PostgresAdapter struct {
	IAdapter
	// contains filtered or unexported fields
}

func (*PostgresAdapter) GetDSN

func (a *PostgresAdapter) GetDSN() (string, error)

func (*PostgresAdapter) GetDbCreateStatement

func (a *PostgresAdapter) GetDbCreateStatement() (string, error)

func (*PostgresAdapter) GetDbDropStatement

func (a *PostgresAdapter) GetDbDropStatement() (string, error)

func (*PostgresAdapter) GetDriver

func (a *PostgresAdapter) GetDriver() (gorm.Dialector, error)

func (*PostgresAdapter) GetServerDSN

func (a *PostgresAdapter) GetServerDSN() (string, error)

func (*PostgresAdapter) GetServerDriver

func (a *PostgresAdapter) GetServerDriver() (gorm.Dialector, error)

func (*PostgresAdapter) SetConfig

func (a *PostgresAdapter) SetConfig(config features.DatabaseConfig)

func (*PostgresAdapter) ValidateConfig

func (a *PostgresAdapter) ValidateConfig() error

type SQLiteAdapter

type SQLiteAdapter struct {
	IAdapter
	// contains filtered or unexported fields
}

func (*SQLiteAdapter) GetDSN

func (a *SQLiteAdapter) GetDSN() (string, error)

func (*SQLiteAdapter) GetDbCreateStatement

func (a *SQLiteAdapter) GetDbCreateStatement() (string, error)

func (*SQLiteAdapter) GetDbDropStatement

func (a *SQLiteAdapter) GetDbDropStatement() (string, error)

func (*SQLiteAdapter) GetDriver

func (a *SQLiteAdapter) GetDriver() (gorm.Dialector, error)

func (*SQLiteAdapter) GetServerDSN

func (a *SQLiteAdapter) GetServerDSN() (string, error)

func (*SQLiteAdapter) GetServerDriver

func (a *SQLiteAdapter) GetServerDriver() (gorm.Dialector, error)

func (*SQLiteAdapter) SetConfig

func (a *SQLiteAdapter) SetConfig(config features.DatabaseConfig)

func (*SQLiteAdapter) ValidateConfig

func (a *SQLiteAdapter) ValidateConfig() error

Jump to

Keyboard shortcuts

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