Versions in this module Expand all Collapse all v1 v1.0.0 Feb 18, 2025 Changes in this version + const DefaultConnectionTimeout + const DefaultPingInterval + const DefaultPoolSize + const DefaultRedialInterval + const DefaultTimeout + const MaxLimit + var ErrConnection = fmt.Errorf("error dial to box") + func GenerateSelectAll(tableName string, fieldNames []string) (string, error) + func QuoteIdentifier(s string) string + type BYTEA []byte + type BaseField struct + UpdateOps []Operation + type Condition struct + Field string + Values []any + func (c Condition) GetValues() [][]any + type Connection struct + func GetConnection(ctx context.Context, postgresOpts *ConnectionOptions) (*Connection, error) + func (c *Connection) Call(ctx context.Context, sql string, args []any) (pgx.Rows, error) + func (c *Connection) Close() + func (c *Connection) Done() <-chan struct{} + func (c *Connection) Info() string + func (c *Connection) InstanceMode() any + type ConnectionOption interface + func WithCredentials(username, password string) ConnectionOption + func WithDatabase(dbName string) ConnectionOption + func WithPoolSize(size int32) ConnectionOption + func WithTimeout(connection time.Duration) ConnectionOption + type ConnectionOptions struct + func NewConnectionOptions(server string, port uint16, mode activerecord.ServerModeType, ...) (*ConnectionOptions, error) + type CursorPosition struct + Order Order + Values []any + type DefaultKeyword bool + const DefaultValueDB + type Index struct + Condition []Condition + DefaultLimit uint16 + Fields OrderedFields + Unique bool + func (i Index) CursorConditions(c CursorPosition, paramsOffset int) (string, []any) + func (i Index) MultiField() bool + func (i Index) OrderConditions() string + func (i Index) ValidateCursor(c CursorPosition) error + type OnConflictAction uint8 + const IgnoreDuplicate + const NoDuplicateAction + const Replace + type Operation struct + Field string + Op activerecord.OpCode + Value any + type Order uint8 + const ASC + const DESC + type OrderField struct + Field string + Order Order + func (of OrderField) String() string + type OrderedFields []OrderField + func (ofs OrderedFields) GetFieldNames() []string + type Query struct + ConditionExists bool + Params []any + QueryString string + func GenerateDelete(tableName string, primaryKey Index, keys [][]any) (*Query, error) + func GenerateInsert(tableName string, pk Index, fieldNames []string, values [][]any, ...) (*Query, error) + func GenerateSelect(tableName string, fieldNames []string, index Index, keys [][]any, ...) (*Query, error) + func GenerateUpdate(tableName string, primaryIndex Index, updates []UpdateParams) (*Query, error) + func NewDeleteQuery(tableName string, pk Index) *Query + func NewInsertQuery(tableName string, fieldNames []string) *Query + func NewSelectQuery(tableName string, fieldNames []string, i Index) *Query + func NewUpdateQuery(tableName string) *Query + func (q *Query) AddLimitOffset(limit, offset uint32) + func (q *Query) AddNoConflictDoNothing(fieldNames []string) + func (q *Query) AddNoConflictDoUpdate(tableName string, pk Index, fieldNames []string) + func (q *Query) AddParams(key ...any) int + func (q *Query) AddQuery(cond string) + func (q *Query) AddReturning(fieldNames []string) + func (q *Query) AddSetStatement(field string, key any) + func (q *Query) AddWhereBlock(cond ...string) + func (q *Query) AddWhereCondition(cond string, key []any) + func (q *Query) AddWhereQuery(cond string) + func (q *Query) ConditionFields(fields []string) + func (q *Query) GenerateWhereKeys(multiField bool, keys [][]any) + type QueryBuilderState uint8 + const QueryBuilderStateLimit + const QueryBuilderStateOffset + const QueryBuilderStateOrderBy + const QueryBuilderStateWhere + type UpdateParams struct + Ops []Operation + PK []any Other modules containing this package github.com/Educentr/go-activerecord/v3