Skip to content

Connect to external databases #18780

Closed
Closed
@fmluizao

Description

@fmluizao

NetBox version

4.1.11

Feature type

Data model extension

Proposed functionality

I have a very specific use case, I'm developing a plugin, and I need to query an external DB.

I thought about being able to define the connection on configuration.py and them merging with Netbox's default db

Here's POC:

fmluizao@ce478be

Would you accept a PR for this?

Use case

You can create a model in a plugin which can query other databases, like

class MyPluginModel(models.model):
   # ...

MyPluginModel.objects.using('otherdbconnection')

Maybe we can even define a custom router to avoid using:

https://docs.djangoproject.com/en/5.2/topics/db/multi-db/#using-routers

Database changes

No response

External dependencies

No response

Metadata

Metadata

Assignees

Labels

complexity: lowRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions