Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

MuMiSQL

A lightweight SQL database engine for embedded systems, written in Pascal.

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

MuMi SQL

Lightweight embedded SQL engine in Pascal.


🌟 Features

  • Pure Pascal – Written in Object Pascal, compiles with Free Pascal.
  • Zero Historical Baggage – Clean design, no legacy compatibility hacks.
  • Embedded by Design – Minimal memory footprint, ideal for resource-constrained devices.
  • Modular Architecture – Core + Plus structure, pluggable components.
  • Cross-Platform – Supports Windows, Linux, macOS, DOS (and more).
  • Interactive REPL – Centered input line, colorful syntax hinting, built-in editor.
  • MIT Licensed – Use it anywhere, freely.

🚀 Quick Start

Prerequisites

Build

bash
# Using Lazarus
open MuMiSQL.lpi and press F9

# Using command line (Windows)
ppc386 MuMiSQL.lpr

# Using command line (Linux/macOS)
fpc MuMiSQL.lpr

Run

bash
./MuMiSQL

Then type SQL commands in the REPL:

sql
SELECT * FROM users WHERE age > 18;

🧩 Project Structure

pascal
MuMiSQL/
????????? Core/          # Core engine (must keep)
???   ????????? Types      # Type definitions
???   ????????? Lexer      # SQL tokenizer
???   ????????? Parser     # SQL parser & AST builder
???   ????????? Executor   # Query executor
???   ????????? Storage    # B-Tree / Page storage
???   ????????? ...
????????? Plus/          # Optional extensions (can be removed)
???   ????????? TUI        # Text user interface
???   ????????? Shell      # Shell command integration
???   ????????? Unicode    # Unicode utilities
???   ????????? ...
????????? repl.pas       # Interactive REPL
????????? commands*.pas  # Built-in commands
????????? MuMiSQL.lpr    # Main entry point

🛠️ Built-in Commands

Command 描述
:help Show available commands
:exit Exit REPL
:listen <ip> <port> Start TCP server
:connect <db> Open another database file
! <cmd> Execute system shell command

📦 Supported SQL (Initial)

  • SELECT ... FROM ... WHERE ...
  • INSERT INTO ... VALUES ...
  • UPDATE ... SET ... WHERE ...
  • DELETE FROM ... WHERE ...
  • CREATE TABLE ...
  • DROP TABLE ...

More features (JOIN, subqueries, indexes) will come as optional Plus extensions.


🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

  • Fork the repo
  • Create your feature branch (git checkout -b feature/amazing)
  • Commit your changes (git commit -m 'Add something')
  • Push to the branch (git push origin feature/amazing)
  • Open a Pull Request

📜 License

Distributed under the MIT License. See LICENSE file for more information.