Pqt Versions Save

Postgres schema definition, sql/go, code generation package.

v0.1.0

7 years ago

Changelog

  • array support - golang postgres driver do not support arrays natively, pqt comes with help:
  • sql generation
  • go generation - it includes:
    • entity - struct that reflects single row within the database
    • criteria - object that can be passed to the Find method, it allows to create complex queries
    • patch - structure used by UpdateBy<primary-key> methods to modify existing entity
    • iterator - 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 function
    • repository - data access layer that expose API to manipulate entities:
      • Count - returns number of entities for given criteria
      • Find - returns collection of entities that match given criteria
      • FindIter - works like Find but returns iterator
      • Insert - saves given entity into the database
      • FindOneBy<primary-key> - retrieves single entity
      • UpdateBy<primary-key> - modifies single entity
      • DeleteBy<primary-key> - modifies single entity
    • func Scan<Entity>Rows(rows *sql.Rows) ([]*<entity>Entity, error) { helper function
  • schema definition - allow to programmatically define database schema, that includes:
    • schemas
    • tables
    • columns
    • constraints
    • relationships

v0.2.0

7 years ago

Changelog

v0.1.1

7 years ago

Changelog

  • Now pqt.TypeJSON and pqt.TypeJSONB generates []byte by default .