package
0.0.0-20241219180511-27a867595d87
Repository: https://github.com/neilalexander/harmony.git
Documentation: pkg.go.dev

# Functions

EndTransaction ends a transaction.
EndTransactionWithCheck ends a transaction and overwrites the error pointer if its value was nil.
InsertMigration creates the migrations table if it doesn't exist and inserts a migration given their name to the database.
IsUniqueConstraintViolationErr returns true if the error is an unique_violation error.
No description provided by the author
NewDummyWriter returns a new dummy writer.
No description provided by the author
NewMigrator creates a new DB migrator.
Open opens a database specified by its database driver name and a driver-specific data source name, usually consisting of at least a database name and connection information.
ParseFileURI returns the filepath in the given file: URI.
Hack of the century.
No description provided by the author
RunLimitedVariablesExec split up a query with more variables than the used database can handle in multiple queries.
RunLimitedVariablesQuery split up a query with more variables than the used database can handle in multiple queries.
TxStmt wraps an SQL stmt inside an optional transaction.
TxStmtContext behaves similarly to TxStmt, with support for also passing context.
WithTransaction runs a block of code passing in an SQL transaction If the code returns an error or panics then the transactions is rolledback Otherwise the transaction is committed.

# Variables

ErrUserExists is returned if a username already exists in the database.

# Structs

No description provided by the author
DummyWriter implements sqlutil.Writer.
ExclusiveWriter implements sqlutil.Writer.
Migration defines a migration to be run.
Migrator contains fields required to run migrations.

# Interfaces

ExecProvider defines the interface for querys used by RunLimitedVariablesExec.
QueryProvider defines the interface for querys used by RunLimitedVariablesQuery.
A Transaction is something that can be committed or rolledback.
The Writer interface is designed to solve the problem of how to handle database writes for database engines that don't allow concurrent writes, e.g.

# Type aliases

StatementList is a list of SQL statements to prepare and a pointer to where to store the resulting prepared statement.