( logger slog.Logger, authorizer rbac.Authorizer, f DatabaseFunc, )
| 1031 | } |
| 1032 | |
| 1033 | func fetch[ |
| 1034 | ArgumentType any, |
| 1035 | ObjectType rbac.Objecter, |
| 1036 | DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error), |
| 1037 | ]( |
| 1038 | logger slog.Logger, |
| 1039 | authorizer rbac.Authorizer, |
| 1040 | f DatabaseFunc, |
| 1041 | ) DatabaseFunc { |
| 1042 | return fetchWithAction(logger, authorizer, policy.ActionRead, f) |
| 1043 | } |
| 1044 | |
| 1045 | // fetchAndExec uses fetchAndQuery but only returns the error. The naming comes |
| 1046 | // from SQL 'exec' functions which only return an error. |
no test coverage detected