contract

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralDatabases

type GeneralDatabases struct {
	GetColumnsOfTableStmt *sqlx.Stmt
	*sqlx.DB
	*configurations.Settings
	Driver string
}

GeneralDatabases represents a base "class" database_i_o_service - for all other concrete database_services it implements partly the Database interface

func (*GeneralDatabases) BeginDatabaseTransaction

func (gdb *GeneralDatabases) BeginDatabaseTransaction() *sqlx.Tx

func (*GeneralDatabases) Close

func (gdb *GeneralDatabases) Close() error

Close closes the database_i_o_service connection

func (*GeneralDatabases) Connect

func (gdb *GeneralDatabases) Connect(dsn string) (err error)

Connect establishes a connection to the database_i_o_service with the given DSN. It pings the database_i_o_service to ensure it is reachable.

func (*GeneralDatabases) IsNullable

func (gdb *GeneralDatabases) IsNullable(column object_model.Column) bool

IsNullable returns true if column is a nullable one

func (*GeneralDatabases) IsStringInSlice

func (gdb *GeneralDatabases) IsStringInSlice(needle string, haystack []string) bool

IsStringInSlice checks if needle (string) is in haystack ([]string)

type IDatabases

type IDatabases interface {
	DSN() string
	Connect() (err error)
	Close() (err error)
	GetDriverImportLibrary() string

	GetTables() (tables []*object_model2.Table, err error)
	PrepareGetColumnsOfTableStmt() (err error)
	GetColumnsOfTable(table *object_model2.Table) (err error)

	IsPrimaryKey(column object_model2.Column) bool
	IsAutoIncrement(column object_model2.Column) bool
	IsNullable(column object_model2.Column) bool

	GetStringDatatypes() []string
	IsString(column object_model2.Column) bool

	GetTextDatatypes() []string
	IsText(column object_model2.Column) bool

	GetIntegerDatatypes() []string
	IsInteger(column object_model2.Column) bool

	GetFloatDatatypes() []string
	IsFloat(column object_model2.Column) bool

	GetTemporalDatatypes() []string
	IsTemporal(column object_model2.Column) bool
	GetTemporalDriverDataType() string

	BeginDatabaseTransaction() *sqlx.Tx
}

Database interface for the concrete database_services

Jump to

Keyboard shortcuts

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