DB_PATH, HTTP_ADDR, HTTP_PORT and LOG_LEVEL parsing with validation; slog text logger with a TRACE level and token redaction; embedded idempotent schema on CGO-free SQLite (WAL, busy timeout); token store (create, list, deactivate, authenticate) and append-only audit store with ordered, limited and windowed queries; shared unit test helpers.
19 lines
537 B
SQL
19 lines
537 B
SQL
-- SPDX-License-Identifier: GPL-2.0-or-later
|
|
-- Copyright (C) 2026 Bryan Joshua Pedini
|
|
|
|
CREATE TABLE IF NOT EXISTS tokens (
|
|
token TEXT PRIMARY KEY NOT NULL,
|
|
description TEXT NOT NULL DEFAULT '',
|
|
active INTEGER NOT NULL CHECK (active IN (0, 1)),
|
|
created_at TEXT NOT NULL,
|
|
deleted_at TEXT NULL
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS operations (
|
|
token TEXT NOT NULL,
|
|
origin TEXT NOT NULL,
|
|
operation TEXT NOT NULL,
|
|
time TEXT NOT NULL,
|
|
FOREIGN KEY (token) REFERENCES tokens(token)
|
|
);
|