myslq

package
v0.0.0-...-e85e4ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL