Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBConnector ¶
type DBConnector interface { // Connect creates new database connection. // // NOTE: // // Connect implementation should return instance of app.ErrUnavailable if target DB is unavailable. // // If caller canceled the context, impl can return context.Canceled/context.DeadlineExceeded errors Connect(ctx context.Context, addr Addr, credentials models.Credentials) (conn ExecutorCloser, err error) }
DBConnector is object that can open new connections
type ExecutorCloser ¶
type ExecutorCloser interface { // Exec performs DB query and return results. // // NOTE: // // Implementation of Exec should return instance of app.ErrUnavailable if DB connection is loosed. // So, caller can decide: try to reconnect and repeat or not. // // If caller canceled the context, impl can return context.Canceled/context.DeadlineExceeded errors Exec(ctx context.Context, query models.Query) (rows models.RowSet, affectedRows int, err error) io.Closer }
ExecutorCloser is object that can make database queries
Click to show internal directories.
Click to hide internal directories.