mysql

package
v0.0.0-...-b841c22 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Statements = statements{
		Inserts: inserts{
			Company:        "CALL InsertCompany(?);",
			Role:           "CALL InsertCompanyRole(?);",
			Modality:       "CALL InsertHealthModality(?);",
			HealthProvider: "CALL InsertHealthProvider(?);",
			Meeting:        "CALL InsertMeeting(?);",
			Staff:          "CALL InsertStaff(?);",
			Customer:       "CALL InsertCustomer(?);",
		},
		Selects: selects{
			Company:         "select * from company where company_id = ?;",
			Roles:           "select * from company_roles where company_id = ?;",
			States:          "select * from country_states;",
			Cities:          "select * from country_cities where state_id = ?;",
			Modalities:      "select * from company_modalities where company_id = ?;",
			HealthProviders: "select * from company_health_providers where company_id = ?;",
			Meetings:        "select * from health.scheduler_meetings where company_id = ? and start_time >= ? and end_time <= ?;",
			Staffs:          "select cs.id, cs.company_id, cs.document, cs.charge_type, cs.job_position, cs.status, cs.color, p.document, p.person_name, p.last_name, p.birthday, p.gender from company_staffs as cs join person as p on cs.document = p.document where cs.company_id = ?;",
			Customers:       "SELECT * FROM health.person where person_type = ? and company_id = ?;",
		},
	}
)

Functions

func NewDefaultClient

func NewDefaultClient() *client

func NewRepository

func NewRepository(db *sql.DB) *persistence

Types

type Repository

type Repository interface {
	Begin(ctx context.Context, options *sql.TxOptions) (*sql.Tx, error)
	Save(ctx context.Context, sql string, args ...interface{}) (int64, error)
	Update(ctx context.Context, sql string, args ...interface{}) (int64, error)
	Fetch(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error)
}

Jump to

Keyboard shortcuts

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