Documentation ¶
Index ¶
- type BaseDbService
- type BaseModel
- type CatalogItem
- type CatalogItemCreateParams
- type CreateParams
- type DeleteParams
- type Query
- type Table
- func (t *Table) BuildCreateStatment(db *sql.DB) (*sql.Stmt, error)
- func (t *Table) BuildFilterStatement(db *sql.DB, filterCols *TableColumns, selectCols *TableColumns, ...) (*sql.Stmt, error)
- func (t *Table) BuildUpdateStatement(db *sql.DB, filterCols *TableColumns, updateCols *TableColumns) (*sql.Stmt, error)
- type TableColumns
- type TableManager
- type UpdateParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseDbService ¶
type BaseDbService interface { }
type CatalogItem ¶
type CatalogItem struct { Id int `json:"id"` Title string `json:"title"` Description string `json:"description"` Url string `json:"url"` ImageFullUrl string `json:"image_full_url"` ImageThumbnailUrl string `json:"image_thumbnail_url"` Published bool `json:"published"` PublishedAt time.Time `json:"published_at"` CreatedAt time.Time `json:"created"` UpdatedAt time.Time `json:"updated"` }
func (*CatalogItem) CreateOne ¶
func (catalogItem *CatalogItem) CreateOne(db *sql.DB, data CatalogItemCreateParams) (*CatalogItem, error)
func (*CatalogItem) GetAll ¶
func (catalogItem *CatalogItem) GetAll(db *sql.DB) ([]CatalogItem, error)
type CatalogItemCreateParams ¶
type Table ¶
type Table struct { Name string Columns TableColumns PkColumn string }
func (*Table) BuildCreateStatment ¶
func (*Table) BuildFilterStatement ¶
func (t *Table) BuildFilterStatement( db *sql.DB, filterCols *TableColumns, selectCols *TableColumns, orderByCols *TableColumns, limit int, ) (*sql.Stmt, error)
func (*Table) BuildUpdateStatement ¶
func (t *Table) BuildUpdateStatement( db *sql.DB, filterCols *TableColumns, updateCols *TableColumns, ) (*sql.Stmt, error)
type TableManager ¶
type TableManager interface { // Get Operations GetOne(*Query) []BaseModel GetMultiple(*Query) []BaseModel // Creation Operations CreateOne(*CreateParams) BaseModel CreateMultiple(*[]BaseModel) []BaseModel // Update Operations UpdateOne(*UpdateParams) int UpdateMultiple(*UpdateParams) int // Delete Operations DeleteOne(*DeleteParams) int DeleteMultiple(*DeleteParams) int // Query Helpers -- should these be privare BuildCreateStatment(db *sql.DB) (*sql.Stmt, error) BuildUpdateStatement(db *sql.DB) (*sql.Stmt, error) BuildFilterStatement(db *sql.DB) (*sql.Stmt, error) // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.