Versions in this module Expand all Collapse all v0 v0.0.2 Nov 14, 2023 Changes in this version + const Eq + const Gt + const Gte + const In + const IsNotNull + const IsNull + const Like + const Lt + const Lte + const NotEq + const NotIn + const NotLike + const NotRegex + const NotRegexI + const Regex + const RegexI + type AddExpression struct + Field1 ModelField + Field2 ModelField + func (e AddExpression) Fields() (ModelField, ModelField) + func (e AddExpression) Sql() exp.LiteralExpression + func (e AddExpression) ToCondition() (Identifiable, []ModelField) + type CalculationExpression interface + Fields func() (ModelField, ModelField) + Sql func() exp.LiteralExpression + type Condition interface + Condition func() (exp.Expression, []ModelField) + type Conditional interface + ToCondition func() (Identifiable, []ModelField) type DeleteDataset + func (d *DeleteDataset) Returning(returning ...interface{}) *DeleteDataset + func (d *DeleteDataset) Scan(dst interface{}) error + func (d *DeleteDataset) ScanOne(dst interface{}) error + func (d *DeleteDataset) WithTx(tx pgx.Tx) *DeleteDataset + type DivisionExpression struct + Field1 ModelField + Field2 ModelField + func (e DivisionExpression) Fields() (ModelField, ModelField) + func (e DivisionExpression) Sql() exp.LiteralExpression + func (e DivisionExpression) ToCondition() (Identifiable, []ModelField) + type InsertDataset struct + func (d *InsertDataset) Returning(returning ...interface{}) *InsertDataset + func (d *InsertDataset) Scan(dst interface{}) error + func (d *InsertDataset) ScanOne(dst interface{}) error + func (d *InsertDataset) String() string + type LiteralExpression struct + Fields []ModelField + Format string + func (e LiteralExpression) Sql() exp.LiteralExpression + func (e LiteralExpression) ToCondition() (Identifiable, []ModelField) type Model + func (m *Model) Field(name string) ModelField + func (m *Model) Init(db *DbClient, model interface{}) error + func (m *Model) Self() SelfFields + type ModelField struct + Field exp.AliasedExpression + Model *Model + func (e ModelField) Add(field ModelField) AddExpression + func (e ModelField) Count() CountExpression + func (e ModelField) Div(field ModelField) DivisionExpression + func (e ModelField) Mul(field ModelField) MultiplicationExpression + func (e ModelField) Sub(field ModelField) SubExpression + func (e ModelField) ToCondition() (Identifiable, []ModelField) + type MultiplicationExpression struct + Field1 ModelField + Field2 ModelField + func (e MultiplicationExpression) Fields() (ModelField, ModelField) + func (e MultiplicationExpression) Sql() exp.LiteralExpression + func (e MultiplicationExpression) ToCondition() (Identifiable, []ModelField) type SelectDataset + func (sd *SelectDataset) OrderAsc(fields ...ModelField) *SelectDataset + func (sd *SelectDataset) OrderDesc(fields ...ModelField) *SelectDataset + type SelfFields struct + Model *Model type SubExpression + func (e SubExpression) Fields() (ModelField, ModelField) + func (e SubExpression) Sql() exp.LiteralExpression + func (e SubExpression) ToCondition() (Identifiable, []ModelField) type UpdateDataset + func (d *UpdateDataset) Returning(returning ...interface{}) *UpdateDataset + func (d *UpdateDataset) Scan(dst interface{}) error + func (d *UpdateDataset) ScanOne(dst interface{}) error + func (d *UpdateDataset) WithTx(tx pgx.Tx) *UpdateDataset v0.0.1 Nov 9, 2023 Changes in this version + const SEPARATOR + func I(ident string) exp.IdentifierExpression + func InitAllModels(modelsStruct interface{}, client *DbClient) + func InitTable(model interface{}, client *DbClient) + func L(sql string, args ...interface{}) exp.LiteralExpression + type And struct + Field interface{} + Op string + Value interface{} + func (el And) Condition(model *Model) (exp.Expression, []string) + type AndGroup []And + func (group AndGroup) Condition(model *Model) (exp.Expression, []string) + type AvgExpression struct + Fields []string + Sql string + func Avg(expression interface{}) AvgExpression + type ConditionGroup []ConditionI + func (group ConditionGroup) Condition(model *Model) (exp.Expression, []string) + type ConditionI interface + Condition func(model *Model) (exp.Expression, []string) + type CountExpression struct + Expression exp.SQLFunctionExpression + Field string + func Count(col string) CountExpression + type DbClient struct + Ctx context.Context + Pool *pgxpool.Pool + func (cli *DbClient) Connect(ctx context.Context, cfg DbConfig) error + type DbConfig struct + Host string + Name string + Password string + PollCount int32 + Port int + User string + type DbField struct + AsValue string + StringValue string + type DeleteDataset struct + Dataset *goqu.DeleteDataset + Model *Model + func (ds *DeleteDataset) Exec() error + func (ds *DeleteDataset) String() string + func (ds *DeleteDataset) Where(conditions ...ConditionI) *DeleteDataset + type Ex = goqu.Ex + type FkModel struct + As string + FromField string + Model Model + ToField string + type Identifiable interface + type Joiner struct + On exp.JoinCondition + Table exp.AliasedExpression + type Model struct + DbClient *DbClient + FieldMap map[string]DbField + FkModels map[string]FkModel + PK string + PreparedJoins map[string]Joiner + PreparedSelectors map[string]exp.AliasedExpression + PreparedSelectorsWithoutAs map[string]exp.IdentifierExpression + TableName string + func (m *Model) Add(instance interface{}) error + func (m *Model) Delete() *DeleteDataset + func (m *Model) FindField(input string) (exp.AliasedExpression, bool) + func (m *Model) FindFieldWithoutAs(input string) (exp.IdentifierExpression, bool) + func (m *Model) FindJoiner(path string) (*Joiner, bool) + func (m *Model) InitConnection(client *DbClient) + func (m *Model) InitFields(model interface{}) + func (m *Model) Insert(rows ...interface{}) ([]int64, error) + func (m *Model) InsertTx(tx pgx.Tx, rows ...interface{}) ([]int64, error) + func (m *Model) PrepareJoins(modelAs string) + func (m *Model) PrepareSelectors(prefix, tableName string) + func (m *Model) Save(instance interface{}) error + func (m *Model) Select(fields ...interface{}) *SelectDataset + func (m *Model) StartTx() (pgx.Tx, error) + func (m *Model) Update(values interface{}) *UpdateDataset + type OrCondition struct + Conditions []ConditionI + func Or(conditions ...ConditionI) OrCondition + func (el OrCondition) Condition(model *Model) (exp.Expression, []string) + type Record = goqu.Record + type SelectDataset struct + Dataset *goqu.SelectDataset + JoinedTables map[string]bool + Model *Model + func (sd *SelectDataset) Limit(limit uint) *SelectDataset + func (sd *SelectDataset) MapScan() ([]map[string]interface{}, error) + func (sd *SelectDataset) Offset(offset uint) *SelectDataset + func (sd *SelectDataset) OrderBy(field string) *SelectDataset + func (sd *SelectDataset) Query() *goqu.SelectDataset + func (sd *SelectDataset) Scan(dst interface{}) error + func (sd *SelectDataset) ScanOne(dst interface{}) error + func (sd *SelectDataset) String() string + func (sd *SelectDataset) Where(conditions ...ConditionI) *SelectDataset + type SqlError struct + Err error + QueryValue string + func (e *SqlError) Error() string + func (e *SqlError) Query() string + type SubExpression struct + Field1 string + Field2 string + func Sub(field1, field2 string) SubExpression + type UpdateDataset struct + Dataset *goqu.UpdateDataset + Model *Model + func (ds *UpdateDataset) Exec() error + func (ds *UpdateDataset) String() string + func (ds *UpdateDataset) Where(conditions ...ConditionI) *UpdateDataset