(ctx context.Context, arg GetConnectionLogsOffsetParams, prepared rbac.PreparedAuthorized)
| 611 | } |
| 612 | |
| 613 | func (q *sqlQuerier) GetAuthorizedConnectionLogsOffset(ctx context.Context, arg GetConnectionLogsOffsetParams, prepared rbac.PreparedAuthorized) ([]GetConnectionLogsOffsetRow, error) { |
| 614 | authorizedFilter, err := prepared.CompileToSQL(ctx, regosql.ConvertConfig{ |
| 615 | VariableConverter: regosql.ConnectionLogConverter(), |
| 616 | }) |
| 617 | if err != nil { |
| 618 | return nil, xerrors.Errorf("compile authorized filter: %w", err) |
| 619 | } |
| 620 | filtered, err := insertAuthorizedFilter(getConnectionLogsOffset, fmt.Sprintf(" AND %s", authorizedFilter)) |
| 621 | if err != nil { |
| 622 | return nil, xerrors.Errorf("insert authorized filter: %w", err) |
| 623 | } |
| 624 | |
| 625 | query := fmt.Sprintf("-- name: GetAuthorizedConnectionLogsOffset :many\n%s", filtered) |
| 626 | rows, err := q.db.QueryContext(ctx, query, |
| 627 | arg.OrganizationID, |
| 628 | arg.WorkspaceOwner, |
| 629 | arg.WorkspaceOwnerID, |
| 630 | arg.WorkspaceOwnerEmail, |
| 631 | arg.Type, |
| 632 | arg.UserID, |
| 633 | arg.Username, |
| 634 | arg.UserEmail, |
| 635 | arg.ConnectedAfter, |
| 636 | arg.ConnectedBefore, |
| 637 | arg.WorkspaceID, |
| 638 | arg.ConnectionID, |
| 639 | arg.Status, |
| 640 | arg.OffsetOpt, |
| 641 | arg.LimitOpt, |
| 642 | ) |
| 643 | if err != nil { |
| 644 | return nil, err |
| 645 | } |
| 646 | defer rows.Close() |
| 647 | var items []GetConnectionLogsOffsetRow |
| 648 | for rows.Next() { |
| 649 | var i GetConnectionLogsOffsetRow |
| 650 | if err := rows.Scan( |
| 651 | &i.ConnectionLog.ID, |
| 652 | &i.ConnectionLog.ConnectTime, |
| 653 | &i.ConnectionLog.OrganizationID, |
| 654 | &i.ConnectionLog.WorkspaceOwnerID, |
| 655 | &i.ConnectionLog.WorkspaceID, |
| 656 | &i.ConnectionLog.WorkspaceName, |
| 657 | &i.ConnectionLog.AgentName, |
| 658 | &i.ConnectionLog.Type, |
| 659 | &i.ConnectionLog.Ip, |
| 660 | &i.ConnectionLog.Code, |
| 661 | &i.ConnectionLog.UserAgent, |
| 662 | &i.ConnectionLog.UserID, |
| 663 | &i.ConnectionLog.SlugOrPort, |
| 664 | &i.ConnectionLog.ConnectionID, |
| 665 | &i.ConnectionLog.DisconnectTime, |
| 666 | &i.ConnectionLog.DisconnectReason, |
| 667 | &i.UserUsername, |
| 668 | &i.UserName, |
| 669 | &i.UserEmail, |
| 670 | &i.UserCreatedAt, |
nothing calls this directly
no test coverage detected