added select plan by id
All checks were successful
gitea-deepak/gogmagog/pipeline/head This commit looks good
All checks were successful
gitea-deepak/gogmagog/pipeline/head This commit looks good
This commit is contained in:
@@ -44,3 +44,12 @@ func (store *postgresStore) SelectPlans() ([]*models.Plan, error) {
|
||||
}
|
||||
return plans, nil
|
||||
}
|
||||
|
||||
func (store *postgresStore) SelectPlanByID(id int) (*models.Plan, error) {
|
||||
plan := models.Plan{}
|
||||
err := store.db.Get(&plan, store.db.Rebind("SELECT plan_id, plan_date FROM plans WHERE plan_id = ?"), id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &plan, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user