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

Sync remote queries #30

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Sync remote queries #30

wants to merge 2 commits into from

Conversation

Brayden
Copy link
Member

@Brayden Brayden commented May 25, 2024

Purpose

To enable users to easily, and with type safety, execute their remote saved queries from Outerbase in their own project we want to enable the ability to sync your saved queries to your project. This ensure you only send query ID's of those that actually exist. When they are deleted from your workspace and you re-sync them, then your project should throw errors alerting you.

In usage:

const connection: OuterbaseConnection = new OuterbaseConnection('FAKE_API_KEY')
connection.runSavedQuery(RemoteQuery['My Query Name'])

Tasks

  • Handlebars takes an array of queries and generates an ./index.ts file that exports an enum of saved remote queries
  • Export the package command for other projects to use
  • Network call uses API token to fetch all saved queries for that base

Verify

  • Open another project
  • Run npm link ../sdk
  • Add to your package scripts sync-remote-queries ./queries API_KEY=your_api_key
  • Run the script npm run sync-remote-queries
  • Verify your saved queries are named in an export in the provided path above

Before

After

@Brayden Brayden self-assigned this May 25, 2024
@Brayden Brayden added the enhancement New feature or request label May 25, 2024
@Brayden Brayden marked this pull request as draft May 25, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant