From ec7de1aa1ad2bc14b3b1572ea4cc5024a6c662ae Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 18 Oct 2025 03:06:09 +0300 Subject: Add ocicl lint --- src/db.lisp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/db.lisp') diff --git a/src/db.lisp b/src/db.lisp index 5d08e6a..8fab0db 100644 --- a/src/db.lisp +++ b/src/db.lisp @@ -6,7 +6,7 @@ (:export :get-inline-bot-type :set-inline-bot-type :with-db)) (in-package :ukkoclot/db) -(defparameter +target-version+ 1 +(defconstant +target-version+ 1 "Intended DB version") (defmacro with-db ((name path) &body body) @@ -20,7 +20,10 @@ (integer->inline-bot-type type-int)))) (defun set-inline-bot-type (db id type) - (execute-non-query db "INSERT OR REPLACE INTO inline_bots (id, type) VALUES (?, ?)" id (inline-bot-type->integer type))) + (execute-non-query db + "INSERT OR REPLACE INTO inline_bots (id, type) VALUES (?, ?)" + id + (inline-bot-type->integer type))) (defun inline-bot-type->integer (type) (case type @@ -66,8 +69,7 @@ (execute-non-query db " CREATE TABLE inline_bots_enum ( id INTEGER PRIMARY KEY, - value TEXT UNIQUE -)") + value TEXT UNIQUE)") (execute-non-query db " INSERT INTO inline_bots_enum(id, value) VALUES (?, 'blacklisted'), (?, 'whitelisted')" @@ -78,6 +80,5 @@ VALUES (?, 'blacklisted'), (?, 'whitelisted')" (execute-non-query db " CREATE TABLE inline_bots ( id INTEGER PRIMARY KEY, - type INTEGER REFERENCES inline_bots_enum(id) -)")) + type INTEGER REFERENCES inline_bots_enum(id))")) (t (error "Unreachable upgrade step reached ~A" new-version)))) -- cgit v1.2.3