HOMEBLOGDEVLOG

Kanboard direct query PostgreSQL

Adam C. Clifton
12 May 2026

Now that Kanboard has been moved to PostgresSQL, we can directly query it with nll-Database from our server. This turns out to be much faster than using the inbuilt API, mainly because default API routes don't return quite enough data for me. So I need to make an extra API request per task just to show a listing.

There is also some HTTP overhead which might make database access faster, but the main issue is all the n+1 queries.

Getting access was simple if not a bit unwieldy writing SELECT statements for everything, so I quickly switched over to generating nll-ORM classes to simplify access. These are actually a bit of a hack, as normally the class generator is pretty strict about the structure I will allow, so i manually created them for Kanboard. Most of the logic is within the base classes we inherit from.

I'll keep API access around for doing any mutations, to make sure triggers and everything continue to work correctly. But any reading can now use the speedy direct access.

Previous: nll-ORM
Next: Validate virtual/override
© Numbat Logic Pty Ltd 2014 - 2026