提供在达到时间限制后过期的表
在与 Datasette 相同的环境中安装此插件。
datasette install datasette-ephemeral-tables
安装后,此插件将确保 Datasette 启动并运行一个名为 ephemeral
的新的命名内存数据库。
在此数据库中创建的任何表将在创建五分钟后自动删除。
所有插件设置都是可选的。在 metadata.yml
中的完整设置集如下所示
plugins:
datasette-ephemeral-tables:
# The name of the in-memory database created by the plugin:
database: ephemeral
# After how many seconds should tables be dropped?
table_ttl: 300
# How often should the plugin check for expired tables (in seconds)?
check_interval: 2
此处显示的数值是默认值。
要在本地设置此插件,首先检出代码。然后创建一个新的虚拟环境
cd datasette-ephemeral-tables
python3 -m venv venv
source venv/bin/activate
现在安装依赖项和测试依赖项
pip install -e '.[test]'
运行测试
pytest