This was an epically long change, and a terrible idea, but it compiles. This was essentially a cascade that came about because I can't blend jet and bob in the same transaction. In for a penny, I guess...
19 lines
649 B
Go
19 lines
649 B
Go
package public
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/db"
|
|
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
|
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/table"
|
|
//"github.com/go-jet/jet/v2/postgres"
|
|
)
|
|
|
|
func CommunicationLogEntryInsert(ctx context.Context, txn db.Tx, m model.CommunicationLogEntry) (model.CommunicationLogEntry, error) {
|
|
m.Created = time.Now()
|
|
statement := table.Communication.INSERT(table.Communication.MutableColumns).
|
|
MODEL(m).
|
|
RETURNING(table.Communication.AllColumns)
|
|
return db.ExecuteOne[model.CommunicationLogEntry](ctx, statement)
|
|
}
|