Skip to content

defaultAdapter behaviour #210

@moitias

Description

@moitias

So, the behaviour for defaultAdapter is still a bit odd in my view.

As it is, there seems to be three different ways for it to work:

  1. model.defaultAdapter = createAdapter(...) - this is as it currently works, as config.defaultAdapter isn't referenced anywhere
  2. model.config.defaultAdapter = createAdapter(...) - this is what the documentation advises
  3. model.config.defaultAdapter = [string] - this is what @mde described in fix crash on SQL datastores when using defaultAdapter #208

I'm guessing the idea is to work towards 3, but it's a bit unclear where would the options for the adapter then come from? 3 has the additional problem of being pretty opaque on when the adapter is actually created - it would be the only adapter not explicitly created by the user.

I'd be happy to sync the documentation and the code to any one of these. My personal preference would be just going for 1 - it seems to be a bit out of place to have the actual adapter in config and option 3 has the abovementioned problems.

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