Socket
Socket
Sign inDemoInstall

@iobroker/db-states-file

Package Overview
Dependencies
132
Maintainers
6
Versions
368
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @iobroker/db-states-file

The Library contains the Database classes for File based states database client and server.


Version published
Weekly downloads
9.9K
increased by21.12%
Maintainers
6
Install size
14.7 MB
Created
Weekly downloads
 

Readme

Source

File DB states classes for ioBroker

The Library contains the Database classes for File based states database client and server.

Redis simulator

The states db client is always a redis client, but if the database type is file, it will communicate with a built-in redis simulator instead of a real redis db.

In the js-controller we use ioredis, the library supports all redis commands by simply calling them on the client instance, like redis.set("foo", "bar"). For an explanation of the commands in native redis, we refer to the redis documentation.

Currently, the following commands are supported by the simulator for states db:

Namespaces

The simulator supports five different namespaces:

  • states (default: io.)
  • messages (default: messagebox.)
  • log (default: log.)
  • session (default: session.)
  • meta (default: meta.)

Overview

CommandState of integrationnamespace
infopartialindependent
quitfullindependent
publishfullall
mgetfullstates
getfullstates, session, meta
setfullstates, meta
setexfullstates, session
delfullstates, session
keysfullstates
psubscribefullmessages, log, states, meta
punsubscribefullmessages, log, states
subscribedummyindependent
configdummyindependent
clientpartialindependent

info

Returns infomration about the simulator.

quit

This will close the connection.

publish

On publish the server will publish to all clients who have subscribed to the states, just like redis does.

mget

mget is used to receive multiple states from the server.

get

get is used to receive a single state from the server.

set

set is used to set a state to the database.

setex

setex is used to set a state to the database which automatically expires after a given time.

del

del deletes a given state from the db.

keys

It returns all matching keys.

psubscribe

Subscribes for a pattern to receive state changes.

punsubscribe

Unsubscribes a pattern to no longer receive state changes.

subscribe

Just a dummy needed to acknowledge expiring keys.

config

Mainly a dummy, just sends a positive response if notify-keyspace-events request received.

client

Is used to handle setname and getname requests. setname is used to change the logging namespace. On getname the server will respond with the current connection name, which has been set via getname.

License

The MIT License (MIT)

Copyright (c) 2014-2023 bluefox dogafox@gmail.com, Copyright (c) 2014 hobbyquaker

Keywords

FAQs

Last updated on 30 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc