Documentation ¶
Overview ¶
Package datastore is the implementation of the database session in use by the server
Index ¶
- func CreateClient(psqlInfo string) (*sql.DB, error)
- func NewNullString(s string) sql.NullString
- func NewNullTime(s string) sql.NullTime
- type ArticleStore
- func (a ArticleStore) CreateArticle(article *domain.Article) error
- func (a ArticleStore) DeleteArticle(id string) error
- func (a ArticleStore) GetArticle(id string) (*domain.Article, error)
- func (a ArticleStore) ListArticles() ([]*domain.Article, error)
- func (a ArticleStore) ListArticlesByParameter(fields ...interface{}) ([]*domain.Article, error)
- func (a ArticleStore) ModifyArticle(article *domain.Article) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
CreateClient will create a new database connection with the supplied psqlInfo
func NewNullString ¶
func NewNullString(s string) sql.NullString
NewNullString helps to create a NULL value in sql query if the field is empty
func NewNullTime ¶
NewNullTime helps to create a NULL value in sql query if the time field is empty
Types ¶
type ArticleStore ¶
PostgresRepository encapsulates a db connection with the operations
func (ArticleStore) CreateArticle ¶
func (a ArticleStore) CreateArticle(article *domain.Article) error
CreateArticle will take the data from the stored file and persist it to the database
func (ArticleStore) DeleteArticle ¶
func (a ArticleStore) DeleteArticle(id string) error
func (ArticleStore) GetArticle ¶
func (a ArticleStore) GetArticle(id string) (*domain.Article, error)
func (ArticleStore) ListArticles ¶
func (a ArticleStore) ListArticles() ([]*domain.Article, error)
func (ArticleStore) ListArticlesByParameter ¶
func (a ArticleStore) ListArticlesByParameter(fields ...interface{}) ([]*domain.Article, error)
func (ArticleStore) ModifyArticle ¶
func (a ArticleStore) ModifyArticle(article *domain.Article) error
Click to show internal directories.
Click to hide internal directories.