Skip to content

Key value store

Simple key value store for storing system variables, user variables, connections and other, data can be encrypted.

kvstore types

There are four types of kvstore.

kv.v. public variables

Examples:

  • kv.v.api.url - used in email templates
  • kv.v.owner.name - used in email templates
  • kv.v.owner.language - default language

kv.user.{username} user personal storage

For johndoe@gmail.com kv.v.user.johndoe_at_gmail_dot_com

kv.sys. internal system variables

  • kv.sys.ftp.account.{account}
  • kv.sys.ftp.status.{account}

kv.connections.{name} internal connections

All keys can be encrypted.

API

POST

HTTP
1
2
3
4
POST {{host}}/api/core/kvstore/user/{{slug}}
Authorization: Basic api:{{token}}

value: {{anyvalue}}

GET

HTTP
GET {{host}}/api/core/kvstore/user/{{slug}}
Authorization: Basic api:{{token}}

DB

SQL
1
2
3
4
5
6
--example 
update app.kvstore set 
    value='ok',
    modified_at = getdate() ,
    modified_by = @username
where slug = `kv.sys.test`
SQL
1
2
3
4
declare @username varchar(200) = '[email protected]'
select value 
  from [app].[kvstore] 
where slug ='kv.user.' +  replace(replace(@username,'.','_dot_'),'@','_at_') + '.defaul_uuid'