class

Mayu::SqliteCounterDatabase

Inherits Mayu::CounterDatabase < Reference < Object

Constants

INCREMENT_STATEMENT = "insert into tb_count (name, created_at, updated_at, num)\nvalues (?, datetime('now'), datetime('now'), 1)\non conflict (name) do update set\n num = tb_count.num + 1,\n updated_at = datetime('now')\nreturning name, num, created_at, updated_at;"
PRUNE_STATEMENT = "delete from tb_count\nwhere num < ?1\n and updated_at is not null\n and updated_at < datetime('now', '-' || ?2 || ' days');"
URL = "sqlite3://./data/count.db?journal_mode=wal&synchronous=normal&busy_timeout=5000"

Constructors

open
Source

Instance methods

create_or_migrate_table
Source