Documentation ¶
Index ¶
Constants ¶
View Source
const ( SqlGetAll = "SELECT * FROM buyers" SqlGetById = "SELECT * FROM buyers where id=?" SqlBuyerWithOrdersById = "SELECT buyers.*, COUNT(purchase_orders.id) as purchase_orders_count\n " + "FROM buyers \n " + "LEFT JOIN purchase_orders \n " + "ON purchase_orders.buyer_id = buyers.id\n" + "WHERE buyers.id = ?\n" + "GROUP BY buyers.id " SqlBuyersWithOrders = "SELECT buyers.*, COUNT(purchase_orders.id) as purchase_orders_count\n " + "FROM buyers \n " + "LEFT JOIN purchase_orders \n " + "ON purchase_orders.buyer_id = buyers.id\n" + "GROUP BY buyers.id " SqlStore = "INSERT INTO buyers (`card_number_id`, `first_name`, `last_name`) VALUES (?, ?, ?)" SqlUpdate = "UPDATE buyers SET card_number_id=?, first_name=?, last_name=? WHERE id=?" SqlDelete = "DELETE FROM buyers WHERE id=?" SqlUniqueCardNumberId = "SELECT id FROM buyers where id != ? and card_number_id = ?" )
Variables ¶
This section is empty.
Functions ¶
func NewRepository ¶
func NewRepository(db *sql.DB) domain.Repository
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.