atviriduomenys / spinta

Spinta is a framework to describe, extract and publish data (a DEP Framework).
MIT License
10 stars 4 forks source link

Custom backend configuration for models #599

Open sirex opened 2 months ago

sirex commented 2 months ago

Add possibility to configure models with a custom backend options. This could be used for things like moving some tables to hypertable.

Configuration could looks like this config.yaml:

backends:
  mybackend:
    type: postgresql
    dsn: postgresql://...

models:
  datasets/gov/example/MyModel:
    backend: mybackend  # specify which backend to use for storing data
    option: value  # add custom, backend specific options for model
    properties:
      my_prop:
        backend: mybackend  # optionally store data in a different backend,
                            # applies for some property types like file type
        option: value  # add custom, backend specific options for property

When running spinta migrate, custom backend specific options must be respected.