SQLite3 state store for Dapr
This project contains a pluggable component for using SQLite3 as a state store with Dapr.
Example usage
See the example folder for an example app and how to run the component.
Docker image
Published on GitHub Container Registry:
ghcr.io/italypaleale/dapr-sqlite-statestore:latest
Supported features
- ✅ CRUD
- ✅ Transactional
- ✅ ETag
- ✅ TTL
- ✅ Actors
- ❌ Query
Setup Dapr component
To setup a SQLite state store, create a component of type state.sqlite. See this guide on how to create and apply a state store configuration.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
spec:
type: state.sqlite
version: v1
metadata:
- name: connectionString
value: mysqlite.db
| Field |
Details |
Example |
connectionString |
The connection string to connect to the database. Usually, that's just the path to a file on disk. If needed, you pass a DSN with the options listed in the docs for go-sqlite3 |
path-to-db.db DSN: file:mydb.db?immutable=1 |
tableName |
Name of the table where to store data |
state |
cleanupIntervalInSeconds |
Interval, in seconds, to purge expired records. Set to <=0 to disable. |
1200 (20 minutes) |