2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00
2024-09-26 23:16:12 +02:00

ParamDB

  • Values are serialized, so arrays and objects can be stored and restored.
  • Not intended to be running as a public service, so there is no authentication, for now.
  • Last value that matches is returned.
  • Unique index on collection+name+validity.

Future

  • Metadata; store with key "meta" in value set post call, returned under a "meta" key in the result list.

Using

Store values

POST /businessinfo
Content-Type: application/json

{
  "openhours": {
    "value": "Mo-Fr 09-17, Sa-Su 12-02",
    "valid": {
      "from": "2024-10-01 00:00:00 +02:00",
      "until": "2024-10-07 23:59:59 +02:00"
    }
  }
}

Retrieve current values

GET /businessinfo

{
  "openhours": "Mo-Fr 09-17, Sa-Su 10-01"
}

Query params:

  • date= - override date (default is now) in the format "Y-m-d H:i:s P"

Retrieve all values

GET /businessinfo/all

{
  "keys": {
    "openhours": [
      {
        "id": 13,
        "value": "Mo-Fr 09-17, Sa-Su 10-01"
      },
      {
        "id": 19,
        "value": "Mo-Fr 09-17, Sa-Su 12-02",
        "valid": {
          "from": "2024-10-01 00:00:00 +02:00",
          "until": "2024-10-07 23:59:59 +02:00"
        }
      }
    ]
  }
}

Query params:

  • only= - comma-separated list of keys to match

Delete value

Delete by posting an array of IDs to delete.

POST /businessinfo/delete
Content-Type: application/json

[ 19 ]

Update a value

Update by including an existing id with the set request.

POST /businessinfo
Content-Type: application/json

{
  "openhours": {
    "id": 19,
    "value": "Mo-Fr 09-17, Sa-Su 12-03",
    "valid": {
      "from": "2024-10-01 00:00:00 +02:00",
      "until": "2024-10-07 23:59:59 +02:00"
    }
  }
}
Description
The ParamDB daemon
Readme 127 KiB
Languages
PHP 96.8%
Makefile 1.9%
Dockerfile 1.3%