Documentation ¶
Index ¶
- Variables
- func DropTables(ctx context.Context, conn Connection, tableName, schemaName string) error
- func DummyQuotedWriteFunc(sb *strings.Builder, word string)
- func Incrementor(s *query.Scope) int
- func RepositoryConfig(cfg *config.Service) (cfgDB *pgxpool.Config, err error)
- func ResetIncrementor(s *query.Scope)
- func StringIncrementor(s *query.Scope) string
- func TestingConfig(t testing.TB) *config.Service
- func TestingPostgresConfig(t testing.TB) *pgxpool.Config
- type Batch
- type Connection
- type DummyBatch
- type Query
- type QuotedWordWriteFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PostgresVersionKey is the query's store key used to set the postgres server version. PostgresVersionKey = pgversion{} // IncrementorKey is the scope's context key used to save current incrementor value. IncrementorKey = incrementorKey{} )
Functions ¶
func DropTables ¶
func DropTables(ctx context.Context, conn Connection, tableName, schemaName string) error
func DummyQuotedWriteFunc ¶
DummyQuotedWriteFunc is the dummy writer for the quoted words.
func Incrementor ¶
Incrementor is the function that returns next query increment value. Used to obtain the queries values with the incremented arguments.
func RepositoryConfig ¶
RepositoryConfig gets the *ConfigDB based on the config.ModelConfig.
func ResetIncrementor ¶
ResetIncrementor resets query's incrementor.
func StringIncrementor ¶
StringIncrementor is the function that returns next query increment value in a string form. Used to obtain the queries values with the incremented arguments.
Types ¶
type Connection ¶
type Connection interface { Exec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error) Query(ctx context.Context, query string, values ...interface{}) (pgx.Rows, error) QueryRow(ctx context.Context, query string, values ...interface{}) pgx.Row SendBatch(ctx context.Context, batch *pgx.Batch) pgx.BatchResults }
Connection is the interface for the connection.
type DummyBatch ¶
type DummyBatch struct {
Queries []*Query
}
func (*DummyBatch) Len ¶
func (d *DummyBatch) Len() int
func (*DummyBatch) Queue ¶
func (d *DummyBatch) Queue(query string, arguments ...interface{})
type Query ¶
type Query struct { Query string Arguments []interface{} }
Query is a single query input for the DummyBatch.
type QuotedWordWriteFunc ¶
QuotedWordWriteFunc is the writer for the quoted words.
Click to show internal directories.
Click to hide internal directories.