Update to
>>26I wasted a bunch of code on writing a query builder. It's time to confess I'm not doing this in Perl. In fact there are few DBI type things available, so I got sidetracked fixing the ergonomics of writing/using queries. On the other hand, after wasting about 100 lines, queries look like this:
dbh SELECT(*) FROM(thread) WHERE(threadId == ${threadId}) execute
dbh BEGIN
dbh INSERT(threadId, comment) INTO(table) VALUES(threadId, comment) execute
dbh COMMIT
You rarely need to type quotes, all interpolations (i.e. VALUES and WHERE clauses) are escaped with the SQLite-specific function.
Still procrastinating on bbcode.
>>31The solution in
>>25 can be done with CGI. The best way to cache the log is to put it in a database and do all that work out-of-process, regardless of whether or not you're doing CGI. RDBMSs are good at: caching, searching, indexing and isolation. It's why we use them.
Caveat: there are cases for in-memory dbs. I wouldn't bother for something like this, because persistence. What are you doing about persistence anyway?
Speaking of >>25, just how stupid of an idea is it?
I wouldn't do it, but at least it's better than having some number of processes banging against a locked file. If you're worried about memory usage, put it in a RDBMS. Again, this will do caching intelligently.