Skip to content
Niš, Serbia

SQLcord

A Discord bot that turns a server into a SQL playground: databases become categories, tables become channels and rows become messages.

Role
Backend & Bot Developer
Platform
Discord (Bot) - Experimental Project
Categories
Bots & Automation, Desktop
Year
2025
SQLcord cover: title and project illustration on a dark background

01 The brief

Assignment

Build a Discord bot that allows users to execute SQL commands interactively inside Discord servers, mapping databases to categories, tables to channels, and rows to messages for an educational and fun SQL learning experience.

Objective

Enable users to learn and experiment with SQL directly within Discord by: - Creating and managing databases as categories - Creating tables with schemas as channels - Inserting rows as messages with full schema validation - Running SELECT queries with advanced WHERE logic - Ensuring SQL-like constraints such as primary keys, VARCHAR limits, and type validation

Built with

  • Rust
  • Serenity (Discord API library)
  • SQL parser (custom)
  • ANSI color-coded logging
  • In-memory data store
  • Slash Commands API

Project overview

Project Background

I built SQLcord, a Discord bot that brings SQL functionality into the chat environment by mapping relational database concepts to Discord primitives (categories, channels, and messages). The challenge was to design a system that accurately enforces SQL constraints (types, primary keys, schema validation) while still being lightweight, interactive, and educational.


Objective

  • Simulate a relational database inside Discord
  • Support schema definition, type validation, and constraints (PRIMARY KEY, VARCHAR size, etc.)
  • Provide an intuitive way to query data with SQL SELECT statements
  • Enforce proper SQL conventions (single quotes, type checking, ISO date validation)
  • Make SQL learning fun and collaborative within Discord communities

Deliverables

  • Functional Discord bot with /sql commands for CREATE, INSERT, and SELECT
  • Schema validation system with error feedback for invalid definitions
  • Support for SQL datatypes: INT, VARCHAR, CHAR, BOOLEAN, FLOAT, DECIMAL, DATE, TIME, DATETIME
  • Primary key enforcement and duplicate prevention
  • Advanced SELECT queries with AND, OR, parentheses, DISTINCT, and grouping
  • Centralized logging system with ANSI formatting for debugging and clarity

Gallery - 03 images

Execution

Phase 1: Research & Planning

  • Analyzed how to map SQL database concepts onto Discord’s structure
  • Designed parser rules for SQL commands and schema validation
  • Planned type validation, primary key enforcement, and error messaging
  • Skills Used: System design, SQL parsing research, bot architecture planning

Phase 2: Development

  • Implemented core commands with Serenity for Discord slash commands
  • Built schema validation for supported SQL datatypes with ISO 8601 compliance
  • Created logging system with ANSI color-coded outputs for consistency
  • Developed dynamic command registration for CREATE/INSERT/SELECT
  • Skills Used: Rust, SQL parser implementation, Discord API, structured logging

Phase 3: Testing & Release

  • Wrote automated tests for command parsing and validation
  • Performed functional tests in Discord servers (CREATE, INSERT, SELECT workflows)
  • Debugged schema validation edge cases (invalid sizes, type mismatches, PK constraints)
  • Published the project as open-source for educational and experimental use
  • Skills Used: Automated testing, Discord bot deployment, open-source release management