Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

This hook runs on models loading. It creates connection-specific models.

License

Notifications You must be signed in to change notification settings

fwoelffel/sails-connection-specific-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

sails-connection-specific-models

This hook runs on models loading. It creates connection-specific models.

Configuration example

module.exports.ConnectionSpecificModels = {

  active: true,
  removeOriginals: true,
  targets: [
    {models: [
      'Model_A',
      'Model_B'
    ],
    connections: [
      'Conn_A'
    ]},
    {models: [
      'Model_A',
      'Model_B',
      'Model_C'
    ],
      connections: [
        'Conn_B'
      ]}
  ]

};

Will generate the following connection-specific models :

  • Model_A_Conn_A
  • Model_B_Conn_A
  • Model_A_Conn_B
  • Model_B_Conn_B
  • Model_C_Conn_B

And will remove :

  • Model_A
  • Model_B
  • Model_C

About

This hook runs on models loading. It creates connection-specific models.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published