Versions in this module Expand all Collapse all v0 v0.1.1 Apr 1, 2024 Changes in this version + type DataFetcher interface + Fetch func(limit, offset int) ([]T, error) + type DataReader interface + GetById func(id K) (T, error) + Retrieve func() ([]T, error) + type DataWriter interface + Delete func(id K) (bool, error) + Insert func(entity T) (K, error) + Update func(id K, entity T) (bool, error) + type ExistenceChecker interface + CheckExistence func(id T) (bool, error) + type Repository interface v0.1.0 Mar 21, 2024 Changes in this version + const NIL_CONNECTION + type DBColumn struct + Table *DBTable + func CreateNewDBColumn(name string, ordinal int) DBColumn + func CreateNewDBColumnFromColumnType(ct sql.ColumnType, ordinal int) DBColumn + func (cd *DBColumn) GetDBType() string + func (cd *DBColumn) GetLength() int64 + func (cd *DBColumn) GetName() string + func (cd *DBColumn) GetNullable() bool + func (cd *DBColumn) GetOrdinal() int + func (cd *DBColumn) GetPrecision() int64 + func (cd *DBColumn) GetScale() int64 + func (cd *DBColumn) GetType() reflect.Type + func (dc *DBColumn) MarshalJSON() ([]byte, error) + type DBCommandInterface interface + Execute func(query string, params ...interface{}) (*sql.Result, error) + Query func(query string, params ...interface{}) (*DBTable, error) + QueryFirst func(query string, params ...interface{}) (*DBRow, error) + func CreateNewDBCommand(con DBConnectionInterface) (DBCommandInterface, error) + type DBConnectionInterface interface + Close func() error + Open func() error + func CreateNewDBConnection(driver string, dsn string) (DBConnectionInterface, error) + type DBRow struct + Table *DBTable + func (dr *DBRow) GetItemByIndex(index int) (interface{}, error) + func (dr *DBRow) GetItemByName(columnName string) (interface{}, error) + func (dr *DBRow) MarshalJSON() ([]byte, error) + func (dr *DBRow) SetItemByIndex(index int, value interface{}) error + func (dr *DBRow) SetItemByName(columnName string, value interface{}) error + type DBTable struct + func CreateNewDBTable() DBTable + func (dt *DBTable) AddDBColumn(column DBColumn) error + func (dt *DBTable) AddDBRow(row DBRow) error + func (dt *DBTable) CreateNewDBRow() DBRow + func (dt *DBTable) GetColumns() []DBColumn + func (dt *DBTable) GetRows() []DBRow + func (dt *DBTable) MarshalJSON() ([]byte, error) + type MockConn struct + func (m *MockConn) Begin() (driver.Tx, error) + func (m *MockConn) Close() error + func (m *MockConn) Ping(ctx context.Context) error + func (m *MockConn) Prepare(query string) (driver.Stmt, error) + type MockConnector struct + func (m *MockConnector) Close() error + func (m *MockConnector) Connect(context.Context) (driver.Conn, error) + func (m *MockConnector) Driver() driver.Driver + type MockDriver struct + func (d *MockDriver) CleanErrorMessage() + func (d *MockDriver) Open(name string) (driver.Conn, error) + func (d *MockDriver) OpenConnector(name string) (driver.Connector, error) + func (d *MockDriver) SetCloseErrorMessage(message string) + func (d *MockDriver) SetConnectorErrorMessage(message string) + func (d *MockDriver) SetPingerErrorMessage(message string)