Documentation ¶
Overview ¶
Package sch1 provides database schema major version 1 verification logic. This implementation may be instantiated indirectly using the github.com/momeni/clean-arch/internal/test/schema package.
Index ¶
Constants ¶
These constants present the relevant major, minor, and patch semantic versions of this schema verifier package. They are initialized based on the stlmig1 package because whenever a new minor version is released, the stlmig1 has to be updated based on it and this verifier needs to verify its updated changes too. Also, the stlmig1 constants are not used directly, so users of this package do not need to import it just for checking the provided semantic version components.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier implements the schema major version 1 verification logic. It implements github.com/momeni/clean-arch/internal/test/schema.Verifier interface and wraps a database connection as noted in New function.
func New ¶
New instantiates a Verifier struct, wrapping the `c` database connection. Since Verifier fields are not exported, the New function is required for its initialization.
func (*Verifier) VerifyDevData ¶
VerifyDevData checks for presence of the development suitable initial data and marks possible issues using the `t` testing argument. Presence of extra rows is acceptable.
func (*Verifier) VerifyProdData ¶
VerifyProdData checks for presence of the production suitable initial data and marks possible issues using the `t` testing argument. Presence of extra rows is acceptable.
func (*Verifier) VerifySchema ¶
VerifySchema uses the corresponding database connection of `v` in order to create and query temporary records in the database (e.g., in an uncommitted transaction), ensuring that the expected database schema with Major major version and Minor minor version is in place. If a more recent minor version was settled, this verification will pass too, so it is important to update this implementation whenever a new minor version is released. This process failures are reported using the `t` testing argument.