package publicreport

import (
	"context"

	"source.gleipnir.technology/Gleipnir/nidus-sync/db"
	"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/publicreport/model"
	"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/publicreport/table"
	//"github.com/Gleipnir-Technology/jet/postgres"
)

func ReportImageInsert(ctx context.Context, txn db.Ex, m model.ReportImage) (model.ReportImage, error) {
	statement := table.ReportImage.INSERT(table.ReportImage.MutableColumns).
		MODEL(m).
		RETURNING(table.ReportImage.AllColumns)
	return db.ExecuteOneTx[model.ReportImage](ctx, txn, statement)
}
func ReportImagesInsert(ctx context.Context, txn db.Ex, m []model.ReportImage) ([]model.ReportImage, error) {
	statement := table.ReportImage.INSERT(table.ReportImage.MutableColumns).
		MODELS(m).
		RETURNING(table.ReportImage.AllColumns)
	return db.ExecuteManyTx[model.ReportImage](ctx, txn, statement)
}
