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

Connection Factory #40

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Connection Factory #40

wants to merge 4 commits into from

Conversation

Brayden
Copy link
Member

@Brayden Brayden commented Jun 26, 2024

Purpose

Currently the way the project is structured, each time we add support for a new connection type it requires the NPM packages to be included for all of them. Our goal is if a user comes to use our SDK and is only seeking to use, say Neon, then we only should require the installation of the Neon serverless driver via NPM.

Tasks

  • Make a factory class
  • Instantiate Connection classes via the factory

Verify

  • In the playground add the following code to query via an Outerbase connection
const connection = await DatabaseFactory.createConnection(DatabaseType.Outerbase, {
        apiKey: 'INSERT_API_KEY'
    });
    const db = Outerbase(connection);

    const { data, error } = await db
        .selectFrom([{ table: 'users', columns: ['*'] }])
        .limit(10)
        .query()

Before

After

@Brayden Brayden self-assigned this Jun 26, 2024
@Brayden Brayden added the enhancement New feature or request label Jun 26, 2024
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