package
0.0.0-20241211204005-80236ea41692
Repository: https://github.com/dhanielsales/go-api-template.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

IsUniqueViolation check if error is a unique constraint violation error.
IsUniqueViolationByField check if error is a unique constraint violation error by field.
No description provided by the author
New initializes and returns a new Storage instance with the given SQL client.
NewMockQuerier creates a new mock instance.
NewMockResult creates a new mock instance.
NewMockSQLDB creates a new mock instance.
NewMockSQLTX creates a new mock instance.
Pagination calculates and returns the pagination limit and offset based on the page and perPage parameters.
Sorting constructs an SQL sorting clause for the specified field and direction.
WithTx manages a database transaction, handling commit or rollback based on the function's success.

# Constants

Ascending order.
Descending order.

# Structs

MockQuerier is a mock of Querier interface.
MockQuerierMockRecorder is the mock recorder for MockQuerier.
MockResult is a mock of Result interface.
MockResultMockRecorder is the mock recorder for MockResult.
MockSQLDB is a mock of SQLDB interface.
MockSQLDBMockRecorder is the mock recorder for MockSQLDB.
MockSQLTX is a mock of SQLTX interface.
MockSQLTXMockRecorder is the mock recorder for MockSQLTX.
PaginationResult represents pagination parameters with limit and offset values.
Storage encapsulates a SQL database client, providing methods for managing connection cleanup and interacting with the database.

# Interfaces

Querier defines an interface for executing SQL queries and statements.
SQLDB represents an SQL database client, extending the Querier interface with methods for transaction management and connection lifecycle.
SQLTX represents an SQL transaction, extending the Querier interface with methods to manage transaction lifecycle.