Skip to content

Refactor: Share Knex Connections between Tenants #117

@nh758

Description

@nh758

#100

Requirements

  1. Use a single Knex client per service

Tasks

  • Write Documentation

Reference

Max Connections Scaling
Can use Knex .withSchema() to set the Tenant DB.

Knex.queryBuilder().withSchema(tenantDB).select() //...
Knex.schema.withSchema(tenantDB).createTable(cb) 

In Objection it should be possible to do this when creating a custom Model. See Vincit/objection.js#85 (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