Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove unused recorder code #590

Merged
merged 1 commit into from
Nov 16, 2024
Merged

feat: remove unused recorder code #590

merged 1 commit into from
Nov 16, 2024

Conversation

domoritz
Copy link
Member

@domoritz domoritz commented Nov 15, 2024

If you want to get the queries that are being run, you can disable caching and consolidation and create a wrapper connector like

export function loggerConnector(connector) {
  const logs = [];

  return {
    snapshot() {
      return logs;
    },
    async query(query) {
      const result = await connector.query(query);
      logs.push({query, result});
      return result;
    }
  }
}

If you want to get the queries that are being run, you can disable caching and consolidation and create a wrapper connector like

```
export function loggerConnector(connector) {
  const logs = [];

  return {
    snapshot() {
      return logs;
    },
    async query(query) {
      const result = await connector.query(query);
      logs.push({query, result});
      return result;
    }
  }
}
```
@domoritz domoritz requested a review from jheer November 15, 2024 02:34
@domoritz domoritz merged commit fdd2633 into main Nov 16, 2024
3 checks passed
@domoritz domoritz deleted the dom/record branch November 16, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants