Postgres schema definition, sql/go, code generation package.
entity
- struct that reflects single row within the databasecriteria
- object that can be passed to the Find
method, it allows to create complex queriespatch
- structure used by UpdateBy<primary-key>
methods to modify existing entityiterator
- structure used by FindIter
methods as a result, it wraps sql.Rows
constants
:
table names
column names
constraints
- library generates exact names of each constraint and corresponding constant that allow to easily handle query errors using ErrorConstraint helper functionrepository
- data access layer that expose API to manipulate entities:
Count
- returns number of entities for given criteriaFind
- returns collection of entities that match given criteriaFindIter
- works like Find
but returns iterator
Insert
- saves given entity into the databaseFindOneBy<primary-key>
- retrieves single entityUpdateBy<primary-key>
- modifies single entityDeleteBy<primary-key>
- modifies single entityfunc Scan<Entity>Rows(rows *sql.Rows) ([]*<entity>Entity, error) {
helper functionschemas
tables
columns
constraints
relationships
[]
instead of {}
[]
instead of {}
[]
instead of {}
Criterion
interface replaced by pqtgo.CompositionWriter
Arguments
, PlaceholderWriter
replaced by pqtgo.Composer, builder like object that keeps buffer and arguments but also tracks positional parameters.