Skip to content

Improve onboarding by having most popular backends integrated by default #47

@jamescmartinez

Description

@jamescmartinez

from #19

--

I could see that being an alternate configuration for 2-3 built-in backends. The existing method of configuration would still work for power users, but passing a string would use a backend with default configuration:

Zero config

Possibly defaults to sqlite backend so no external service is needed to start using OpenWorkflow:

const ow = new OpenWorkflow();

Backend string option

Looks for OPENWORKFLOW_BACKEND_DB environment var:

const ow = new OpenWorkflow({ backend: 'postgres' }); // or { backend: 'sqlite' }

Backend option (current)

Customize backend with other options (like namespaceId) or use community backend:

const backend = await BackendPostgres.connect(postgresUrl);
const ow = new OpenWorkflow({ backend });

As far as tree-shaking (relevant to serverless environments), the backend string is a runtime config and wouldn't be able to tree-shake. But the backends are very minimal so not a big concern.

Originally posted by @nathancahill in #19 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions