outerbase / sdk

Typescript ORM and automated model generation direct from your database schema. Supports Outerbase features for saved queries & AI.
https://outerbase.com
MIT License
12 stars 5 forks source link

Connection constructor named object #26

Closed Brayden closed 5 months ago

Brayden commented 5 months ago

Purpose

Previously for classes that implemented Connection interface, each constructor could have it's own custom arguments needed to fulfill it's classes usage. When you list out the arguments when constructing a new instance of it you would have to know what argument goes in what order, and the arguments differ per Connection class.

This change makes it so each Connection constructor now takes an object that has a type associated to it so you can see what the values required are.

Resolves #10

Tasks

Verify

Before

const d1 = new CloudflareD1Connection(
    'API_KEY',
    'ACCOUNT_ID',
    'DATABASE_ID'
)

After

const d1 = new CloudflareD1Connection({
    apiKey: 'API_KEY',
    accountId: 'ACCOUNT_ID',
    databaseId: 'DATABASE_ID'
})